March 28, 2024, 11:33:06 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


conversion tips needed

Started by Jerry Muelver, November 30, 2006, 03:23:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerry Muelver

What's the most rational way to process old IBasic code (Standard and Pro) to EBasic? Like, for Standard:

1) Add endsub to each sub.
2) Change istring handling to heap handling (?)
3) Change "dictionary" routines to Muelver's Famous ibhash routines.
4) .... ?

I get tons of compiling errors, claiming "syntax error - ," or "syntax error - )", that I can't seem to sort out. Of course, I could start simple, and learn things one step at a time, but that would break a lifelong habit of jumping right in -- Ready, Fire, Aim!

Zen

He he Ready, Fire, Aim. Best way I say Jerry! Hmm well like Paul said, there will be some internal changes to Ebasic for compatability with Aurora in the next update. Most IBasic Pro code should be fine, and compile straight away. I have not yet had time to play around with Ebasic yet though.

Lewis

GWS

Hi Jerry,ÂÃ,  :)

I've done several Pro conversions and they have run with no changes I can recall.

Standard needs updating to Pro style code - which as you say means mostly checking the 'endsub's are there, changing 'window ...' to 'openwindow ...', and the control definition syntax.

For instance for a button:

change: control w1,"B,Exit,525,450,bW,bH,@CTLBTNFLAT,1"
to:ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  control w1,@button,"Exit",525,450,bW,bH,@CTLBTNFLAT,1

Oh, and if you've got any instr$() statements, check those too, 'cos I think the 'starting at' parameter was moved from the front of the parameters to the last ..

That should more or less do it .. :)

all the best,

Graham
Tomorrow may be too late ..

Jerry Muelver

November 30, 2006, 04:20:40 AM #3 Last Edit: November 30, 2006, 04:26:14 AM by Jerry Muelver
Must be something more to it, for Standard. For instance, I get clear on a whole bunch of subs, then I get
"syntax error - ," for line 226, which is the
ibval=""
line in this sub:


'------------------------------------------------------------------

SUB ibhashget(ibhash,ibkey)
' finds ibkey in ibhash array, returns paired value.
' adds "{" to the end of the istring to allow the last
' value in the hash to be found, removes "{" before
' returning the hash to normalize the istring.
DEF ibx,iblen:int
DEF ibk,ibval:string
ibk = "{"+ibkey+"}"
ibhash = ibhash + "{"
ibval = ""
ibval = extractstr(ibhash,ibk,"{")
ibhash = left$(ibhash,len(ibhash)-1)
return ibval
endsub

So, where's the comma error? If I delete that line, and just leave a blank line there, I still get the same error on recompiling, with the error message now pointing to the blank line.

mrainey

Our old friend Steve Boothman (bevets) wrote a program to convert Standard to Pro.  I don't have a copy any more, maybe somebody else does.

I also have an UltraEdit macro that does pretty well.  Let me know if you're interested.


                                              Mike
Software For Metalworking
http://closetolerancesoftware.com

mrainey

Jerry,

Need a return type on the sub?
Software For Metalworking
http://closetolerancesoftware.com

Jerry Muelver

Could be. I'll check the Help files and see what I have to do about return types. Thanks, Mike.

Jerry Muelver

Okay, Mike. I got it compiled. Return types (ISTRING was not liked), and INSTR handling, was about it. I got a warning "Local data size 64004" for a dimensioned ISTRING local var, and may have to juggle passing ISTRING and returning STRING stuff (that's the heap buisness, I seem to recall), but we're on the way.

Haim

The old conversion program - I have it. (the executable)
How can I make it available to the forum?
I do not know how to attach a file. - can someone tell me how?


Jerry Muelver

When you're posting a message, look for the "Additional Options" link at the bottom left of the input window. One of the options is "Attach". However, you can not attach EXE files -- just txt, doc, pdf, jpg, gif, png, zip, src, and inc. So if it's an EXE, zip it first.

Haim

Thanks for the explanation.

and the attachment follows...