Author Topic: CPCEval - Simple Evaluation Tool for CPC464 and 6128  (Read 1362 times)

0 Members and 1 Guest are viewing this topic.

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77

Hello!


I was quite amazed when I saw the charts and evaluation graphics in the demo programs that were shipped with every CPC464 and CPC6128. Being a big fan of the superior Loco Basic, I tried to imitate what I saw there (which I did not manage entirely - I use mode 2 only and no isometric 3D perspective).


Why did I do this, knowing that MS Excel is 1000x better? Because I could and because it was fun. Maybe some of you find a way to use this simple tool and you create your own charts and keep your CPC occupied for a little while with this program.


Still missing:


- Sending an evaluation screen to real printer (I don't know yet, how to do this)
- Using bubble sort for 2 axis in table mode. I only manage to sort one column separately, but not the corresponding other one. The sorting code is currently inactive and can be found at line 1950. AMSDOS, do you have an idea?
« Last Edit: 23:57, 14 June 17 by Bytebreaker »

Offline SRS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 581
  • Country: de
  • Schneider CPC464 - what else ?
  • Liked: 567
  • Likes Given: 311
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #1 on: 00:15, 15 June 17 »
For printing there are some "hardcopy" routines ... and about 2d bubble - https://en.wikipedia.org/wiki/Bubble_sort ?
#
hope that helps



Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #2 on: 09:47, 15 June 17 »
@Bytebreaker: You can output text to a printer with

PRINT#8,"hello"

#9 is the tape/disc, #0-#7 are windows.

If the printer is Epson compatible you can use it's control codes to enhance the output:

http://lprng.sourceforge.net/DISTRIB/RESOURCES/PPD/epson.htm

to turn on condensed printing:

print #8,chr$(27);chrs$(15)

It *is* possible to output the screen as graphics to the printer ("hardcopy" as SRS says) from basic. To do this you need to read pixels from the screen (8 columns at a time) and use "9-pin graphics" mode. You will also need to adjust the line spacing to move down after you draw 1 strip of graphics.

It'll be slower in basic but it will work. :)

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #3 on: 09:51, 15 June 17 »
Great thanks for the info!


Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #4 on: 09:54, 15 June 17 »
Great thanks for the info!
You're welcome.

The problem is that I doubt any emulators will do this.

I know JavaCPC has printer emulation but i'm not sure how advanced it is and  if it does graphics or not.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #5 on: 12:01, 15 June 17 »
I will work on the sorting problem first anyway. The real printing would have been additional luxury.
I already got hints from my C64 friends on how to solve the issue to keep a second table column sync'ed when sorting the first one.


The sorting then also takes effect on the diagrams, i.e you see the bars, pies etc. in the sorted order, then.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.773
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1021
  • Likes Given: 1731
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #6 on: 13:58, 15 June 17 »
Unfortunately I'm unable to get to an Amstrad to have a look at your code. The Bubble sort routine I incorporated earlier into a Telephone Database concentrated on sorting the names from one field and repositioning the the phone number alongside it, though I wasn't sure if you looking to take Information from 2 Different Tables and use some Sorting process on it or if you're looking to sort 2 Tables seperate from Smallest to Largest or something like that.




I remember using an emulator to print out a page straight to a printer and that would of been going back to the DOS emulators, I cannot remember if I was using a Star NX-1000 printer I had or the NEC P7 I'd acquired. I think I did print out some stuff on the NEC, I don't know which emulator I was using for it, it could of been CPCEMU, RWCPC or CPE52, I don't think I had Caprice at that stage and was using a 486DX2-66. One of the CPC Programs I remember using was Powerpage (unsure if it was 64 or 128).
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #7 on: 22:17, 15 June 17 »
@ AMSDOS


The sorting use case only deals with one array that has two dimensions: werte$(30,1).
werte$(i,0) contains the x-Axis Values. werte$(i,1) contains the y-Values. It is all string, which, depending on the chart type, will be converted to numbers or left "as is".


Let's say dimension 0 contains names and dimension 1 contains highscores, then I need the names at the right places when sorting by score and vice versa the scores at the right places when sorting by name.


As far as I can overlook it right know I need key assignments that link fields to each other. I must use these as an index, so I can rearrange the second column after sorting the first and vice versa. I guess this will be the direction I'll go to solve this.


I am still very interested in your phonebook code and the sorting algorithm you have implemented.

Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 1.198
  • Country: gr
    • Parts from the past.
  • Liked: 677
  • Likes Given: 1717
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #8 on: 23:34, 15 June 17 »
Fantastic, I was obsessed with this back then.
Never bought a printer for my cpc, but I used to print through an amiga using cpc emulator and a star lc 200.

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #9 on: 00:16, 16 June 17 »
Thanks!


I will shortly implement a sorting feature + min, max and average value display in Table view.


The solution for the 2-column-sort is a modified insertion sort. Thanks to my friend Michael Kircher I could write something like this:




10 dim w$(7,1)
20 w$(1,0)="tom":w$(1,1)="50"
30 w$(2,0)="fritz":w$(2,1)="70"
40 w$(3,0)="klaus":w$(3,1)="20"
50 w$(4,0)="gabi":w$(4,1)="90"
51 w$(5,0)="hans":w$(5,1)="30"
52 w$(6,0)="peter":w$(6,1)="10"
53 w$(7,0)="lutz":w$(7,1)="80"


61 print chr$(147)
63 print "unsorted array:":print
64 for i=1 to 7
65 print w$(i,0),w$(i,1)
66 next i


67 print


100 for i=2 to 7:a=val(w$(i,1)):b$=w$(i,0)
110 for j=i-1 to 1 step -1
115 if val(w$(j,1))>a then w$(j+1,1)=w$(j,1):w$(j+1,0)=w$(j,0):next
120 w$(j+1,1)=str$(a):w$(j+1,0)=b$:next i


163 print "sorted array:":print
164 for i=1 to 7
165 print w$(i,0),w$(i,1)
166 next i


167 end



Replace line 61 with "cls" and it should work on a CPC too. I did this problem solving on C64 with v2 basic. I will post here when the improved version is finished. Then you can save your evaluations in a sorted state. This affects the order of the pies, bars and line diagrams, too.
« Last Edit: 00:25, 16 June 17 by Bytebreaker »

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #10 on: 02:54, 16 June 17 »
So here it is. CPCEval with the option to sort both columns.
After doing so you can save the evaluation including changed sort order and you can watch the sorting effect on changed bar/pipe/line charts.


Please keep in mind that for proper number sorting you need filling zeroes so all numbers have the same length (i.e. 3->03  or 3->003)



« Last Edit: 02:56, 16 June 17 by Bytebreaker »

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.773
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1021
  • Likes Given: 1731
Re: CPCEval - Simple Evaluation Tool for CPC464 and 6128
« Reply #11 on: 13:10, 17 June 17 »

I am still very interested in your phonebook code and the sorting algorithm you have implemented.


It's not really mine, the sorting routine (a Bubble Sort) was part of the BASIC tutorial series Glynne Davies was running for ACU in 1991. It was badly presented by ACU, though it was the kind of tutorial which presented many programs and would setup exercises for you to implement.


You can find the series guide of programs and Disk Image here, the phonebook code I was referring to which the Tutorial set as an exercise is the program called DBASEEX.BAS from Part 5 which uses the Bubble Sort from Part 4 (BUBBLE.BAS).
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3