Da 0wner
2009-07-05 15:58:36
Format is a function recently added to SCAR in 3.20.
Is is in Delphi.
It is very useful to use.
They are added wherever a %(INSERTDATATYPEHERE) is added in the string.
d: integer
s: string
g: extended/float
x: hex (19005 to 4A3D)
The above are datatypes.
So
If you wish to distinguish between different indexes in the array you can do so like:
You do not need to add the index number if they are in order.
Lmao, I know that tutorial was terrible. I hope you understand…pretty hard to explain. I suck at writing simple tutorials.
Part of it might be that its 5:29AM.
Is is in Delphi.
It is very useful to use.
function Format(s: string; data: array of const): string;S is the string you wish to format. Data is the data you will add to the result.They are added wherever a %(INSERTDATATYPEHERE) is added in the string.
d: integer
s: string
g: extended/float
x: hex (19005 to 4A3D)
The above are datatypes.
So
format('I ate %d apples.', [5]);would return 'I ate 5 apples.'If you wish to distinguish between different indexes in the array you can do so like:
format('I ate %1:d apples and %0:d pears.', [3, 4]);would return 'I ate 4 apples and 3 pears.'You do not need to add the index number if they are in order.
format('I ate %d apples and %d pears.', [4, 3]);would return 'I ate 4 apples and 3 pears.'Lmao, I know that tutorial was terrible. I hope you understand…pretty hard to explain. I suck at writing simple tutorials.
Part of it might be that its 5:29AM.