Page 3 of 3

TABLE commands

Posted: Mon Oct 22, 2018 11:57 am
by proclaimadmin
TABLEAMEND
TABLECANCEL
TABLECLEAR
TABLECOPY
TABLECOUNT
TABLECREATE
TABLEDELETE
TABLEFIRST
TABLEGETCURRENT
TABLELAST
TABLENEXT
TABLEPREVIOUS
TABLEREFRESHALL
TABLEREFRESHCURRENT
TABLEREFRESHSELECTED
TABLERESET
TABLESAVE
TABLESELECT
TABLESELECTCOUNT
TABLESETCURRENT
TABLETRUECOUNT

Re: [Sticky] INDEX: list of Proclaim Maths functions

Posted: Tue Oct 23, 2018 12:12 pm
by revellbikes
Any examples of what they do?!

LISTITEM

Posted: Fri Nov 09, 2018 2:53 pm
by steve
returns a character string from a list, based on an integer position

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
CAVEAT/BUG
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

Posted: Sun Feb 03, 2019 2:19 pm
by Netwiseit
Can an example of Rounding UP / Down be added and linked into the list of functions please.

Thanks in advance.

ROUND

Posted: Mon Feb 04, 2019 9:08 am
by steve
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

Code: Select all

vin = 11.26252
vout = ROUND( vin , 2 , -1 )
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!