[Sticky] INDEX: list of Proclaim Maths functions
-
- Site Admin
- Posts: 55
- Joined: Wed Nov 30, 2011 9:37 pm
- Has thanked: 1 time
- Been thanked: 4 times
TABLE commands
TABLEAMEND
TABLECANCEL
TABLECLEAR
TABLECOMMIT
TABLECOPY
TABLECOUNT
TABLECREATE
TABLEDELETE
TABLEFIRST
TABLEGETCURRENT
TABLELAST
TABLENEXT
TABLEPREVIOUS
TABLEREFRESHALL
TABLEREFRESHCURRENT
TABLEREFRESHSELECTED
TABLERESET
TABLESAVE
TABLESELECT
TABLESELECTCOUNT
TABLESETCURRENT
TABLETRUECOUNT
TABLECANCEL
TABLECLEAR
TABLECOMMIT
TABLECOPY
TABLECOUNT
TABLECREATE
TABLEDELETE
TABLEFIRST
TABLEGETCURRENT
TABLELAST
TABLENEXT
TABLEPREVIOUS
TABLEREFRESHALL
TABLEREFRESHCURRENT
TABLEREFRESHSELECTED
TABLERESET
TABLESAVE
TABLESELECT
TABLESELECTCOUNT
TABLESETCURRENT
TABLETRUECOUNT
-
- Posts: 543
- Joined: Fri Jun 15, 2012 12:44 pm
- Has thanked: 18 times
- Been thanked: 56 times
LISTITEM
returns a character string from a list, based on an integer position
LISTITEM (list , element , character)
example
CAVEAT/BUG
If you use a field for defining your starting list, then do not use the comma delimiter as it doesn't work.
LISTITEM (list , element , character)
example
Code: Select all
vlist = "Monday,tuesday,wednesday,thursday,friday,saturday,sunday"
v1 = listitem(vlist,1,","{
message ("first day is ",v1)
#prints Monday
If you use a field for defining your starting list, then do not use the comma delimiter as it doesn't work.
Code: Select all
#set up example alpha field with comma delimited text
put( "Monday,tuesday,wednesday,thursday,friday,saturday,sunday", {mytext field.Alpha})
#retrieve field into variable
vlist = TEXT( {mytext field.Alpha})
v1 = listitem(vlist,1,",")
#or v1 = listitem({mytext field.Alpha},1,",") - doesn't work either
vcount =listsize(vlist,",")
message ("Count: ",vcount) #returns 1!
message ("first day is ",v1) #errors: prints Monday,tuesday,wednesday,thursday,friday,saturday,sunday
Re: [Sticky] INDEX: list of Proclaim Maths functions
Can an example of Rounding UP / Down be added and linked into the list of functions please.
Thanks in advance.
Thanks in advance.
ROUND
ROUND(variable , <decimalplaces> , <method>)
where <method>:
-1 = round down next digit
0 = if(digit >=5), round up, else round down
1 = round up to next digit
example:
round 11.26252 down to the nearest 2 decimal places
ROUND command is exceedingly picky about syntax and format
it MUST be input with spaces surrounding each parameter, namely:
ROUND( variable , decimalplaces , method)
ROUND([space][variable][space][comma][space][decimalplaces][space][comma][space][method][space])
[method] is as before:
-1 = round down next digit
0 = if(digit >=5), round up, else round down
1 = round up to next digit
If this layout is not followed, then the code will compile, but be corrupted upon compilation and not save. The danger is that you click ACCEPT without first CHECKing your code, and this will be saved with the corruption and no error. So always Syntax CHECK prior to saving!
where <method>:
-1 = round down next digit
0 = if(digit >=5), round up, else round down
1 = round up to next digit
example:
round 11.26252 down to the nearest 2 decimal places
Code: Select all
vin = 11.26252
vout = ROUND( vin , 2 , -1 )
it MUST be input with spaces surrounding each parameter, namely:
ROUND( variable , decimalplaces , method)
ROUND([space][variable][space][comma][space][decimalplaces][space][comma][space][method][space])
[method] is as before:
-1 = round down next digit
0 = if(digit >=5), round up, else round down
1 = round up to next digit
If this layout is not followed, then the code will compile, but be corrupted upon compilation and not save. The danger is that you click ACCEPT without first CHECKing your code, and this will be saved with the corruption and no error. So always Syntax CHECK prior to saving!
GETDATA
Please delete if there is already one for this command, but I only came across this today, and found it to be very useful...
Code: Select all
vcase = "100001"
OPEN( vcase , "LOCK" )
v-max = GETDATA( vcase , {MED-Max Cases.Number} )
v-num = GETDATA( vcase , {MED-Current Cases.Number} )
#MESSAGE( "Current" v-num )
#MESSAGE( "Max" v-max )
IF v-num > v-max THEN
PUT( "01" , {MED- Provider.Code} )
ELSE
PUT( "02" , {MED- Provider.Code} )
v-num = v-num + 1
END
PUTDATA( vcase , {MED-Current Cases.Number} , v-num )
UPDATE( vcase , "" )
UPDATE( vcase , "UNLOCK" )
Last edited by BCC on Thu May 16, 2019 9:49 am, edited 1 time in total.
-
- Site Admin
- Posts: 55
- Joined: Wed Nov 30, 2011 9:37 pm
- Has thanked: 1 time
- Been thanked: 4 times
Re: GETDATA
thanks for the addition, greatly appreciated. I have added a link to the index for this.
Re: [Sticky] INDEX: list of Proclaim Maths functions
CONTAINS and BEGINS are not in this list
or if the word Bill will always be the first part of the field value then: IF {Field.Value} BEGINS "Bill" THEN
These can be further expanded if you then want:
Credit to @ISimpson viewtopic.php?t=815
Code: Select all
IF {Field.Text} CONTAINS "Bill" THEN
These can be further expanded if you then want:
Code: Select all
IF {Field.Value} BEGINS "Bill" OR {Field.Value} CONTAINS "Hill" OR {Field.Value} BEGINS "SomethingElse" THEN
-
- Site Admin
- Posts: 55
- Joined: Wed Nov 30, 2011 9:37 pm
- Has thanked: 1 time
- Been thanked: 4 times
-
- Posts: 59
- Joined: Thu Oct 29, 2015 10:04 am
- Location: Kent
- Has thanked: 40 times
- Been thanked: 4 times
Re: [Sticky] INDEX: list of Proclaim Maths functions
Hi All,
I've just triggered syntax highlighting for the keyword "NOT", I thought it might work like it does in Python eg.
The word "IN" doesn't get highlighted.
Does anyone have any idea how it's used?
Thanks
I've just triggered syntax highlighting for the keyword "NOT", I thought it might work like it does in Python eg.
Code: Select all
If NOT IN [12,23,13] THEN
Does anyone have any idea how it's used?
Thanks