Help about variables/objects

Discussion in 'Questions (Windows Mobile)' started by skipper, Dec 19, 2007.

  1. skipper

    skipper Member Licensed User

    Hello all,
    is there any limitation on the number of variables, objects used in an application?

    I'm having some troubles with global variables. The app I'm writing is a kind of wizard that uses 8 panels and quite a lot of label, textbox and combobox objects. Now, in addition to the few global variables used to manage the page transition (next, prev), I added some global variables to store few stuff like the db_path, db_name and so on. The new global variables are not assigned and a msgbox in the AppStart shows an empty string. If I move the declaration of the new variables at the beginning of the Sub Globals, I gain access to the above variable but the contents of some of previoulsy defined variables get lost.

    Any idea? Too many variables? Too many objects?

    Thanks a lot for your help
    Mimmo
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    There is no limit to the number of variables or objects.
    Can you post some of your code?
     
  3. skipper

    skipper Member Licensed User

    Thanks Erel!

    Sure! I'm attaching the entire folder. The Wizard starts from File|Certificato
    There is no db engine at the moment...only interface. Please check the global variable xdbPath in the Global Section (used with msgBox in AppStart)

    thanks again
    Mimmo
     
  4. agraham

    agraham Expert Licensed User

    I don't mean to butt in but Erel is probably very busy at the moment. The problem is here but the compiler isn't erroring it!

    xColor=230,230,255

    try

    xColor=Rgb(230,230,255)
     
  5. skipper

    skipper Member Licensed User

    Many thanks Agraham! I did a quick try and it seems to work. Now I'll add all the other stuff and I'll let you know.

    May be I misundestood the Color syntax. The help reports

    Example: Button1.Color = 255,0,0 'Red color

    and I used the same syntax to assign a default color to a variable.

    What a great forum!

    :)

    Mimmo
     
  6. agraham

    agraham Expert Licensed User

    Hmm - I tried that. It actually works in code, to my surprise, but obviously not in Globals where it messes up other initialisations. Maybe it's a hangover from earlier versions of B4PPC.

    Using RGB() and its converse GetRGB() is the "correct" way to handle colour conversions and will be compatible with the forthcoming version 6.0 compiler which will be much more rigorous in its' checking than the current v5.80.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    That is correct.
     
Loading...