Predefined System Constants

Started by Humpher, April 18, 2014, 08:14:46 AM

Previous topic - Next topic

Humpher

According to the help file the following Predefined System Constants have a corresponding integers.
Can anyone tell me what the integers are for the constants below?
@Wait
@NoWait
@GetprocID

Thanks for the help...

dblaze1

waitval = @Wait
nowaitval = @NoWait
getprocidval = @GetprocID

Return 34, 33, 35 in order.

Deana

The easiest way to determine a value is to simply display the constant in a Message:

Code (winbatch) Select
Message('waitval' , @Wait)


Or here is a script that dynamically grabs all WIL Constants and their corresponding values into an array and displays them in a ReportView:

Code (winbatch) Select


;***************************************************************************
;**   udfWILConstantArray
;**
;** Purpose: Returns an array of all WIL Constants and values   
;** Inputs:
;** Outputs: Results in a Reportview
;** Reference:
;**
;** Developer: Deana Falk 2014.04.18
;***************************************************************************

#DefineFunction udfWILConstantArray()
   constlist = IntControl(77, 100, 0, 0, 0) ;tab-delimited list of WIL function table entries
   arrconstlist = Arrayize(constlist, @TAB)
   totalcount = ArrInfo(arrconstlist, 1 )-1
   ;Move thru array grabbing all constants
   arrnewconstlist = ArrDimension( totalcount, 2 )
   count = 0
   For ii = 0 To totalcount
       funcdetails = arrconstlist[ii]
       arrconst = Arrayize(funcdetails, Num2Char(255))
       constname = arrconst[5]
       If StrSub( constname, 1, 1 ) == '@'
           arrnewconstlist[count,0] = constname
           value = %constname%
           If !IsNumber(value) ;deal with CR LF and CRLF
              value = 'displayable value'
           Endif
           arrnewconstlist[count,1] = value
           count = count+1
       EndIf   
   Next
   Return arrnewconstlist
#EndFunction

arraylist = udfWILConstantArray()

;output =  DirScript():'WIL_Constants_List.csv'
;ArrayFilePutCsv(output, arraylist)

;Display result in reportView
MyDialogFormat=`WWWDLGED,6.2`

MyDialogCaption=`WIL Constants and Values`
MyDialogX=002
MyDialogY=059
MyDialogWidth=382
MyDialogHeight=353
MyDialogNumControls=003
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,0|128|192`
MyDialogConfig=0

MyDialog001=`099,329,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`237,329,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`015,019,346,298,REPORTVIEW,"ReportView_1",arraylist,DEFAULT,DEFAULT,30,2621440,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")
Exit
Deana F.
Technical Support
Wilson WindowWare Inc.

Humpher

Thanks Deana this is something I can use later as well.
I did not even think to display it in a message duh....:)

Thanks again.

Quote from: Deana on April 18, 2014, 08:48:23 AM
The easiest way to determine a value is to simply display the constant in a Message:

Code (winbatch) Select
Message('waitval' , @Wait)


Or here is a script that dynamically grabs all WIL Constants and their corresponding values into an array and displays them in a ReportView:

Code (winbatch) Select


;***************************************************************************
;**   udfWILConstantArray
;**
;** Purpose: Returns an array of all WIL Constants and values   
;** Inputs:
;** Outputs: Results in a Reportview
;** Reference:
;**
;** Developer: Deana Falk 2014.04.18
;***************************************************************************

#DefineFunction udfWILConstantArray()
   constlist = IntControl(77, 100, 0, 0, 0) ;tab-delimited list of WIL function table entries
   arrconstlist = Arrayize(constlist, @TAB)
   totalcount = ArrInfo(arrconstlist, 1 )-1
   ;Move thru array grabbing all constants
   arrnewconstlist = ArrDimension( totalcount, 2 )
   count = 0
   For ii = 0 To totalcount
       funcdetails = arrconstlist[ii]
       arrconst = Arrayize(funcdetails, Num2Char(255))
       constname = arrconst[5]
       If StrSub( constname, 1, 1 ) == '@'
           arrnewconstlist[count,0] = constname
           value = %constname%
           If !IsNumber(value) ;deal with CR LF and CRLF
              value = 'displayable value'
           Endif
           arrnewconstlist[count,1] = value
           count = count+1
       EndIf   
   Next
   Return arrnewconstlist
#EndFunction

arraylist = udfWILConstantArray()

;output =  DirScript():'WIL_Constants_List.csv'
;ArrayFilePutCsv(output, arraylist)

;Display result in reportView
MyDialogFormat=`WWWDLGED,6.2`

MyDialogCaption=`WIL Constants and Values`
MyDialogX=002
MyDialogY=059
MyDialogWidth=382
MyDialogHeight=353
MyDialogNumControls=003
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,0|128|192`
MyDialogConfig=0

MyDialog001=`099,329,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`237,329,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`015,019,346,298,REPORTVIEW,"ReportView_1",arraylist,DEFAULT,DEFAULT,30,2621440,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")
Exit