To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 8967
8966  |  8968
Subject: 
vb variable size
Newsgroups: 
lugnet.robotics
Date: 
Sun, 12 Dec 1999 08:59:04 GMT
Viewed: 
410 times
  
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?

What's wrong???

thanks

Mike



Message has 1 Reply:
  Re: vb variable size
 
(...) 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 (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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR