IonicWind Software

IWBasic => Console Corner => Topic started by: Jerry Muelver on November 30, 2006, 03:23:15 AM

Title: conversion tips needed
Post by: Jerry Muelver on November 30, 2006, 03:23:15 AM
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!
Title: Re: conversion tips needed
Post by: Zen on November 30, 2006, 03:51:31 AM
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
Title: Re: conversion tips needed
Post by: GWS on November 30, 2006, 04:08:45 AM
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
Title: Re: conversion tips needed
Post by: Jerry Muelver on November 30, 2006, 04:20:40 AM
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.
Title: Re: conversion tips needed
Post by: mrainey on November 30, 2006, 04:22:35 AM
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
Title: Re: conversion tips needed
Post by: mrainey on November 30, 2006, 04:24:55 AM
Jerry,

Need a return type on the sub?
Title: Re: conversion tips needed
Post by: Jerry Muelver on November 30, 2006, 04:27:45 AM
Could be. I'll check the Help files and see what I have to do about return types. Thanks, Mike.
Title: Re: conversion tips needed
Post by: Jerry Muelver on November 30, 2006, 04:58:09 AM
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.
Title: Re: conversion tips needed
Post by: Haim on November 30, 2006, 06:21:15 AM
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?

Title: Re: conversion tips needed
Post by: Jerry Muelver on November 30, 2006, 06:39:13 AM
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.
Title: Re: conversion tips needed
Post by: Haim on November 30, 2006, 06:58:33 AM
Thanks for the explanation.

and the attachment follows...