IonicWind Software

IWBasic => General Questions => Topic started by: Guilect on May 28, 2010, 10:51:51 AM

Title: question about line continuation
Post by: Guilect on May 28, 2010, 10:51:51 AM
Okay , I am ready to look silly on this one.
A most simple thing seems not to be working for me.
I wish to use line continuation to format the look of some code.
From the help file:
QuoteSource lines may be continued into the next editor line by appending an underscore _ after a comma or white space at the end of a line."
I have tried both an underscore imediately after the comma and an underscore after a space.
Yet, the following causes the parser to not like it.

What is the correct syntax to do this?
sub test4(a as int,_
b as int,_
c as int,_
d as int)

print str$(a+b+c+d)
end SUB

test4(0,1,2,3)

WAITCON
end


Thanks,
Guilect
Title: Re: question about line continuation
Post by: LarryMc on May 28, 2010, 01:06:07 PM
It appears that the portion of the parser that handles SUB statements does not recognize that rule.

For example, the following will work fine and I have used this structure in several programs:

sub test4(a as int,b as int,c as int,d as int)

print str$(a+b+c+d)
end SUB

test4(2,_
4,_
6,_
1)


WAITCON
end



LarryMc
Title: Re: question about line continuation
Post by: LarryMc on May 28, 2010, 01:18:29 PM
Also this will work:

declare import, CreateWindowExA(dwExStyle:int, _
   lpClassName:string, _
   lpWindowName:string, _
   dwStyle:int, _
   x:int, _
   y:int, _
   nWidth:int, _
   nHeight:int, _
   hWndParent:int, _
   hMenu:int, _
   hInstance:int, _
   lpParam:pointer),HANDLE


LarryMc
Title: Re: question about line continuation
Post by: Guilect on May 29, 2010, 05:44:19 AM
Thanks Larry.
Thought I might be using it incorrectly.

Maybe for v2.0 of IWB we can have that implemented  ;)