Android Tutorial Converting VB6 to B4A

Housefly

Member
Licensed User
Longtime User
CInt in roundup of VB6 to B4A doesn't seem to be working.

The following doesn't seem to be supported. would be cool if it did.

B4X:
General:
-------

CInt

so for fun I just used it in my naming conventions, reserved word (in VB) be darned!

it casts to the value I want.. perhaps someone knows a better way?

B4X:
Dim CInt as Int

...

CInt = (ListView.Height / ListView.SingleLineLayout.ItemHeight)
 
Last edited:

shb777

Active Member
Licensed User
Longtime User
The best thing about vb 6 was the forms, and controls you could drag onto them, to quickly write programs. Does basic4android have that? That's what we need.
 

Z80CPU

Member
Licensed User
Longtime User
Silly Question

i am OLD school when it comes to programming basic....line numbers and all...

moved from basic for dos to visual basic now to B4A.

my questions are:

in visual basic you have:

#1 - a= "123" + "456" -> a="123456"

#2 - a=chr(65) + chr(66) -> a="ab"

#3 - if x>2 then goto somelabel

#4 -
a=time$: a=a+10
:label
doevents
if time$<a then goto label else goto timesup


#5 - is there a B4A ver of 'doevents' and 'sleep'?


#6 - does the ability to NOT declare variables at start of app, just declare them 'on the fly' except for public/static varis.

example, in vb6, i can write (of course, i must 'turn off' declare in options somewhere):

a="+":b=2:c=3
d=trim(str(b)) + a+trim(str(c))+" = 5"
msgbox d ( d = "2+3 = 5")


all on the 'fly'

what would be the B4A versions of these?

also, is there a more 'complete' crossover guide for vb6 -> B4A than the short one that is listed here and i think in the manual?



you're more than welcome to just email me if you wish:

z80cpu at google's email


thanks for helping a putz VERY MUCH!

 

NJDude

Expert
Licensed User
Longtime User
#1 - a= "123" + "456" -> a="123456"

#2 - a=chr(65) + chr(66) -> a="ab"
These are the B4A equivalents:
B4X:
a= "123" & "456

#3 - if x>2 then goto somelabel
There's no GOTO in B4A

#4 -
a=time$: a=a+10
:label
doevents
if time$<a then goto label else goto timesup


#5 - is there a B4A ver of 'doevents' and 'sleep'?
As explained above there's no GOTO, but there's DoEvents, also, there's no Sleep, you have to use TIMERS
Yes, you don't have to declare variables if you don't want to, B4A will default the type to STRING.

For more info I recommend you read the manuals, look at the links on my signature below, especially the DOCUMENTATION one, you will find 2 documents on the top of the screen.

Welcome to B4A!.
 

Beja

Expert
Licensed User
Longtime User
Hi,
I can't see the equiv of A = NOT B
 

Beja

Expert
Licensed User
Longtime User
Thanks Klaus so much..

@LucaMs
does this mean that B is the compliment of A.. also this is good because I work on electronics.
B4X:
Dim A, B As Byte
B = 255
A = Bit.Not(B)Log("A = " & A)
'A = 00
 

Beja

Expert
Licensed User
Longtime User
Is this the only use.. In fact now I want to define a value as true or false (not binary negation)
 

Beja

Expert
Licensed User
Longtime User
Button1_Click
DoorOpen = NOT(DoorOpen)

is that correct?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…