Subject:
|
Re: vb variable size
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sun, 12 Dec 1999 18:02:54 GMT
|
Viewed:
|
614 times
|
| |
| |
In article <FMMEAG.1xw@lugnet.com>, "mike mcfarlane"
<mike.mcfarlane@virgin.net> wrote:
> Allo
> Hopefully someone can help. I'm sending the following code to my RCX when I
> click on a vb menu item:
>
> Private Sub mnuFiveHundred_Click()
> SetDatalog 500
> lego.SetVar 12, CON, 500
> End Sub
>
> ie setting variable 12 to 500 in immediate mode. Variable 12 is then used by a
> downloaded program to set a number of program loops. The variable works fine
> up to 255 and does the required number of loops. But 256 or greater, doesn't
> work. I thought variables could go up to 32k. Could it be something in VB?
The variables are 16 bit signed (-32768 to 32767), but the loop counter is
only an 8 bit unsigned (0 to 255). When you set the loop counter from a
variable it ignores the high bits and truncates.
Dave Baum
--
reply to: dbaum at enteract dot com
|
|
Message has 1 Reply: | | Re: vb variable size
|
| Hi (...) Yep you're right Dave and I feel pretty stupid. The loop command is only good up to 255, so I'm now using a while...end while. I need to learn to read the RCX SDK parameter table a bit better. So much to learn, so much fun. Cheers ;-) Mike (25 years ago, 12-Dec-99, to lugnet.robotics)
|
Message is in Reply To:
| | vb variable size
|
| Allo Hopefully someone can help. I'm sending the following code to my RCX when I click on a vb menu item: Private Sub mnuFiveHundred_Click() SetDatalog 500 lego.SetVar 12, CON, 500 End Sub ie setting variable 12 to 500 in immediate mode. Variable 12 (...) (25 years ago, 12-Dec-99, to lugnet.robotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|