![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello there,
Firstly I am a new member so "HELLO EVERYONE!!!" My question is - "is there a Randomize function?" A bit now about me ... My 25 years experience has been starting out using BASIC on Commodore PET, through to VIC 20, C64, IBM PC GW-BASIC, Turbo Pascal, then Visual Basic, then HTML / Javascript, then ASP. Access and SQL databases I also run from a work point of view. I have also dabbled, though not heavily with CoBOL, ASM and C. I am a programmer with 25 years experience and have now ventured into programming in Pocket PC devices... I am just starting out (2 weeks ago) with these devices and have explored what programming languages are available for them - I tried Embedded VB from MS but wasnt happy with it not being able to make EXE files. I have recently looked at PPL from ArianeSoft which seems pretty good but its too C oriented for my liking ... then I found Basic4PPC which seems more like my kettle of fish ![]() I have made a program in VB6 which I am now converting to a Pocket PC format and am using the Trial version of Basic4PPC to see if I can do it ... if so, I will buy Basic4PPC and rock on from there! So, initial thoughts are quite good but being ultimately from a Commore PET (Microsoft) BASIC background, I feel some commands are either missing or use different terminology, so, at the moment I am ploughing through conversion from VB6 to Basic4PPC and have made some Basic functions (sorry, Subs !!!) which take MS BASIC commands and then return values using the Basic4PPC functions. I did search on the forums for LEFT RIGHT LEN MID VAL CINT CSTR INSTR LCASE UCASE TRIM etc but nothing found, so if someone searches now they will find these ... Quote:
Once I have done a full conversion of my VB6 app to Basic4PPC, I will issue a library for people to plug in to as there may be other functions which are different and need adding to the library. Not sure how it would affect performance, but for large conversions, it will make it easy for people to do a quick conversion of their large app to make a judgement if they want to continue with the conversion. Some things will need modding, such as File handling ... but the above will help for people with backgrounds of MS / Commodore PET ish backgrounds. Thats it for now ... I will carry on converting for now... Steve Last edited by badkarma : 03-15-2008 at 02:02 PM. |
|
|||
|
Thanks for the reply agraham.
I did come across the rnd function, but on other BASICs there is also a "Randomize" function which generate a seed number so it doesnt pick the same number everytime you start the program - but I have just tested it and it picks a different number every time now, so I guess the engine auto-randomizes on execution. Thanks for the reply, Steve |
|
||||
|
Small corrections:
Code:
Sub vbCrLf
Return Chr(13) & Chr(10)
'Or Return CRLF
End Sub
Sub Val(val_str) 'Not necessary.
Return 0 + val_str
End Sub
Sub CInt(cstr_str) 'Not necessary.
Return 0 + cstr_str
End Sub
Another solution for Trim (using regular expressions): Trim Spaces from Beginning and end of Strings |
|
|||
|
Thanks for the updates Erel.
I did notice the Trim post but was thinking of trying to keep all my code 'in-house' without using plug ins - not sure if the Match / Regex are plug ins yet --- still new to this app ( 3 hours old now ) but will investigate these later for additional options on what they can do.Also, being an *old* BASIC coder, i use... "string" + "string" instead of "string" & "string" Is there a difference? Always wanted to know... but could never find anything out about this ... Many thanks Steve |
|
|||
|
Thanks Erel,
I am experiencing some work OK, but others dont, until you put & instead of + Quote:
In the line MyFileData = MyFileData & r & Chr(10)" above, the Run errors if '+' is used... Ah well ... the old dog will have to learn new tricks - but looking good so far - I am impressed!Cheers |
|
|||
|
Many thanks agraham, (i see also that you live just down the road ... I live in Wigan) ...
The above now makes more sense to me. My app I am converting is 1500 or so lines and I am well into conversion now ... once converted fully and tested I will definately push the "Buy It Now" button - probably around payday near the end of March. It does compile to EXE for ARM processors I take it (IPAQ rw6815)?... I guess it will say somewhere on the site - will delve a bit more shortly into the docs on the website. At the moment its more of a RTFM later and have a play first ... ![]() Just in case anyone is looking at the above functions, I have had to put in some "" checks before running the LEFT / MID / RIGHT functions as I get an error on checking strings with a length of zero ('startindex cannot be less than zero' when using RIGHT function).... so here is the updates ... (official set of functions to follow in a bit once I have tested to destruction ... Quote:
Steve Last edited by badkarma : 03-15-2008 at 07:37 PM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|