XYBASIC

98 views
Skip to first unread message

villa...@gmail.com

unread,
Feb 7, 2023, 11:41:34 AM2/7/23
to IMSAI 8080esp
Is it possible to increase WIDTH to e.g 255 (like MSBASIC) ?  - although it accepts 255 on entry (whichever version) it is always seems limited to 80 chars.
Some of my functions are longer than 80 chars and I can't see of way of 'beating' it !!!

udo....@freenet.de

unread,
Feb 7, 2023, 12:33:35 PM2/7/23
to IMSAI 8080esp
If you answer the WIDTH question on startup with 255 it works:

for i=1 to 300:print "A";:next
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
OK

villa...@gmail.com

unread,
Feb 7, 2023, 12:56:40 PM2/7/23
to IMSAI 8080esp
Thank you Udo but  .....if I want to do 
10  DEF FNRECT$(X1%, Y1%, X2%, Y2%) = CHR$(27)+"_GRECT"+STR$(X1%)+";"+STR$(Y1%)+";"+STR$(X2%)+";"+STR$(Y2%)+"$"

it's  truncated to

10  DEF FNRECT$(X1%, Y1%, X2%, Y2%) = CHR$(27)+"_GRECT"+STR$(X1%)+";"+STR$(Y1%)
  
It won't wrap round on to new line but stops at 80 chars - even though I put in 255 at start up.  My version ??

udo....@freenet.de

unread,
Feb 7, 2023, 2:10:49 PM2/7/23
to IMSAI 8080esp
Hm OK, it seems that the length of the input line is limited to 80 characters:

XYBASIC EDIT REV 2.14
COPYRIGHT 1978, 1979, 1980, 1981 BY MARK WILLIAMS COMPANY, CHICAGO
WIDTH? 255
END OF MEMORY?
48243 BYTES FREE

OK

10  DEF FNRECT$(X1%, Y1%, X2%, Y2%) = CHR$(27)+"_GRECT"+STR$(X1%)+";"+STR$(Y1%)+
list

10  DEF FNRECT$(X1%, Y1%, X2%, Y2%) = CHR$(27)+"_GRECT"+STR$(X1%)+";"+STR$(Y1%)+

OK

I copied and pasted your line from the posting above into the terminal, but it gets truncated. The WIDTH setting affects line lenght for output only.

udo....@freenet.de

unread,
Feb 7, 2023, 4:50:21 PM2/7/23
to IMSAI 8080esp
The lenght of a program line is limited to 80 characters, see manual p. 128 EDIT command.

villa...@gmail.com

unread,
Feb 7, 2023, 6:04:43 PM2/7/23
to IMSAI 8080esp
Never got that far in the manual !!!! but thank you. Another member gave a workable solution - to break the statement down into parts which works fine.

e.g
10 CRN$=STR$(X1%)+";"+STR$(Y1%)+";"+STR$(X2%)+";"+STR$(Y2%)
20  DEF FNRECT$(X1%, Y1%, X2%,Y2%)=CHR$(27)+"_GRECT"+CRN$+"$"

Le Fauve

unread,
Feb 9, 2023, 4:32:32 AM2/9/23
to IMSAI 8080esp
Hi,

On Wednesday, February 8, 2023 at 9:04:43 AM UTC+10 villa...@gmail.com wrote:
Never got that far in the manual !!!! but thank you. Another member gave a workable solution - to break the statement down into parts which works fine.

e.g
10 CRN$=STR$(X1%)+";"+STR$(Y1%)+";"+STR$(X2%)+";"+STR$(Y2%)
20  DEF FNRECT$(X1%, Y1%, X2%,Y2%)=CHR$(27)+"_GRECT"+CRN$+"$"

Are you sure that works?
It seems to me that CRN$ will be defined once (with current values of X1%,Y1%,X2%,Y2%), and your call to FNRECT$() will always return the same string.

You could go with something like this (untested):
0        1         2         3         4         5         6         7
12345678901234567890123456789012345678901234567890123456789012345678901234

--------------------------------------------------------------------------
10 R1$=CHR$(27)+"_GRECT":DEF FNR2$(x%,y%)= STR$(X%)+";"+STR$(Y%)
20 DEF FNRECT$(X1%,Y1%,X2%,Y2%)=R1$+FNR2$(X1%,Y1%)+";"+ FNR2$(X2%,Y2%)+"$"

Cheers,
Eric

Le Fauve

unread,
Feb 9, 2023, 4:36:18 AM2/9/23
to IMSAI 8080esp
I'm not sure why, but the list screwed my text formatting again (the BASIC part was in "Courier New", which is a monospaced font).
That was supposed to make it easy to count the characters (line 20 is 74 characters, so it does fit).

villa...@gmail.com

unread,
Feb 9, 2023, 5:14:22 AM2/9/23
to IMSAI 8080esp
Thank you Eric, you are absolutely correct! I did find that although it could draw a rectangle the parameters were fixed!  The principle of breaking down a long line into shorter components is the way to go to overcome the 80 char restriction.  I ran your solution in a loop with random values for X & Y - works perfectly.
I have it all working in BBCBASIC (no line length restrictions) but wanted to do it in XYBASIC because it has some better I/O handling and 'INTERUPTS' which I would like to play with.
Colin
Reply all
Reply to author
Forward
0 new messages