Post by angusmann on May 31, 2008 16:54:07 GMT -5
Hi all. I'm loving Run Basic so far but I have a problem with the code below.
When I run this code it seems to enter an infinite loop and times out. Problem is, I can't see where the loop is. If I change the sub LoadColorSchemes to [LoadColorSchemes] and access it via a GOTO it seems to work just fine !?
Can anyone see the flaw in the code? I've stared at it for ages.
Thanks,
Angus
Stefan: placed code-ending-tag at the end of the code, where it belongs to
When I run this code it seems to enter an infinite loop and times out. Problem is, I can't see where the loop is. If I change the sub LoadColorSchemes to [LoadColorSchemes] and access it via a GOTO it seems to work just fine !?
Can anyone see the flaw in the code? I've stared at it for ages.
Thanks,
Angus
'VARIABLES
'cs$(X,Y) Color Scheme X, y=1-9=colors
'ncs(X) Name of color scheme X
'ncs Number of color schemes
'spw Screen pixel width
'q$ Quotation mark - chr$(34)
'DIM things and set variables
dim cs$(9,10)
dim ncs$(20)
spw=800
q$=chr$(34)
global spw, q$, ncs
'**********************************************************
'* CODE LIVES HERE ! *
'**********************************************************
call LoadColorSchemes
print "There are ";ncs;" color schemes."
'**********************************************************
'* CODE ENDS HERE ! *
'**********************************************************
end
sub LoadColorSchemes
ncs=0
[readcsloop]
read a$
if a$="END" then goto [exitreadcsloop]
print ncs
ncs=ncs+1
ncs$(ncs)=a$
for a=1 to 9
read a$
cs$(ncs,a)=a$
next a
goto [readcsloop]
[exitreadcsloop]
end sub
data "Standard", "#9EBECA","#7F9AA3","#61767D","#C9B89D","#A38F7F","#7D6D61","#363636","#C9C9C9","#000000"
data "Eighteen", "#C7D499","#A3AD7D","#7F8761","#D4B998","#AD987D","#877661","#2B2B2B","#D4D4D4","#000000"
data "Bleu", "#99CAFF","#82ACD9","#6B8EB3","#FFF099","#D9BD82","#B39C6B","#000000","#FFFFFF","#000000"
data "Greems", "#C9E0C1","#A7BAA0","#84947F","#DEE0C1","#B8BAA0","#92947F","#1F1F1F","#E0E0E0","#000000"
data "Hitman 8", "#D2B87D","#AB9667","#857550","#8E9B9E","#D1D1D1","#FFFFFF","#2E2E2E","#D1D1D1","#000000"
data "Schwarz", "#C6DAFD","#A7B8D6","#8997B0","#FCFBC5","#D6CDA7","#B0A889","#030303","#FCFCFC","#000000"
data "Rainforest","#AEC784","#8DA16A","#6B7A51","#C7B383","#A1906A","#7A6E51","#383838","#C7C7C7","#000000"
data "What", "#83C2C9","#6A9DA3","#51797D","#C9A183","#A3796A","#7D5D51","#363636","#C9C9C9","#000000"
data "Winter", "#C6D5E6","#A4B1BF","#848E99","#E6E1C5","#BFB7A4","#999384","#1A1A1A","#E5E5E5","#000000"
data "END"
Stefan: placed code-ending-tag at the end of the code, where it belongs to