Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / VB to DBPro - how to read VB command layout.

Author
Message
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th Apr 2012 13:43
Hi, found a program which I am tring to convewrt but there a bit is does that I am not sure how you read to get it to do the same in DBPro.

it looks like this



the line that I am not sure about is second from end, is it put the result there or trying to call the function again.
Got most of the code converted but cannot see how that be works.

here a link to page with the full code.
http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=33826&lngWId=1


here's what I have so far in DBPro



Dark Physics makes any hot drink go cold.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Apr 2012 16:27 Edited at: 12th Apr 2012 16:33
I think it's this....

ConvertToBarCode = str$(bar_str) + str$(check_digit) + "~"


...or you may have to add $ strings to the end of you arrays, like bar_str$, and check_digit$

Or it might just work how it is, but I always use the $ character on strings.

ShaunRW
DBPro Developer
18
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 12th Apr 2012 17:06
Also, I don't think you can do this mystr = """". If you want quotation marks in a string you have to do use this chr$(34).

HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th Apr 2012 18:58
ShaunRW seem you are right, however the complier also say I cannot use chr$(34), so now I am wondering how do I do a " in case format.


case """ not allowed
case chr$(34) not allowed
case ""+chr$(34)+"" not allowed
case """" ok but I think this means ""

so any other way of writing it " in a case select.

Dark Physics makes any hot drink go cold.
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 12th Apr 2012 19:53
You may have to leave that special circumstance for the 'case default' and then do an 'if' check rather than a case. Not ideal by any means but I can't think how else to achieve it off the top of my head. I don't believe that DarkBASIC has a way of escaping characters other than the 'chr$()' method but as that is a function call it doesn't count as a string literal and hence can't be used in the 'case'.


Previously TEH_CODERER.

Login to post a reply

Server time is: 2026-07-09 20:55:04
Your offset time is: 2026-07-09 20:55:04