Announcement

Collapse
No announcement yet.

Equates from string CVQ CVDWRD

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cliff Nichols
    replied
    Maybe thats what it is .... Thanks Paul

    I have no problem with CVQ, but it drove me nuts trying to figure out what I was doing wrong with other CV commands. (All I was getting was "Syntax Error" and the more I stared at it .... the more confused I got about "What Syntax Error?....I can NOT see an error"


    I guess my next tests will be to find out if the number given is a Windows Handle (like GetDlgItem(HwndDlg, %Button) ) or just some number generator that the compiler understands????

    Leave a comment:


  • Paul Dixon
    replied
    Chris,
    from the help file under "Equates"
    If an expression is used, all parts of the expression must consist of constants, numeric equates; bitwise operators like AND, OR; and NOT; the arithmetic operators +, -, *, /, and \, and the relational operators >, <, >=, <=, <>, =; and the CVQ function.
    So it looks like CVQ is specifically allowed but the other Cxx functions are not.

    Paul.

    Leave a comment:


  • Cliff Nichols
    started a topic Equates from string CVQ CVDWRD

    Equates from string CVQ CVDWRD

    I was playing around with some code I tripped upon in the manual, but I really don't quite get what the manual is telling me.
    I thought the manual was telling me I could declare an equates using a string for the value, but what I don't get is why CVQ would work but CVDWD or CVL do not?

    At first I thought it was the length of the string (1 char = 1 byte) but that does not seem to be it.

    What am I missing????? (Or completely misunderstanding????)

    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "Win32Api.inc"
    
    TYPE Form
         FrmName AS ASCIIZ * %MAX_PATH
    END TYPE
    
    TYPE FrmButton
         BtnName AS ASCIIZ * %MAX_PATH
         BtnCaption AS ASCIIZ * %MAX_PATH
         BtnTop AS DWORD
         BtnLeft AS DWORD
         BtnHeight AS DWORD
         BtnWidth AS DWORD
    END TYPE
    
    %Form1  = CVQ("FrmForm133333333333333333333333333333333333333333333")
    '%Form2  = CVDWD("F")                   'Uncomment for error
    '%Form3  = CVl("Form")                   'Uncomment for error
    %Button1 = CVQ("Button1")
    %Button2 = CVQ("Button2")
    
    %Form  = CVQ("Form")
    %Button = CVQ("Button")
    
    %Button3 = %BUTTON + 1
    %Button4 = %BUTTON + 2
    
    FUNCTION PBMAIN () AS LONG
    
        MSGBOX STR$(%FORM1) + $CR + STR$(%BUTTON1) + $CR + STR$(%BUTTON1)
        MSGBOX STR$(%FORM) + $CR + STR$(%BUTTON)
    '    MSGBOX STR$(%FORM2)      'Uncomment for error
        MSGBOX STR$(%FORM) + $CR + STR$(%BUTTON3) + $CR + STR$(%BUTTON4)
    
    END FUNCTION
Working...
X