! String utils

Post Reply
User avatar
Dutchman
Posts: 148
Joined: Tue Aug 06, 2019 4:47 pm
Location: Netherlands

! String utils

Post by Dutchman » Tue Nov 19, 2019 9:15 pm

! String utils {/Extensions/Strings/! String utils}
contains functions for text handling
Str_ is a 'container' for character dimensions etc.
F# is a shorthand function for number format

Code: Select all

' {/Extensions/Strings/! String utils}
'[ Functions for text ]
'
CALL Str_ ' Initiate container
[––––––––––––––––– Constants and variables –––––––––––––––––]
DEF Str_
' container for constants, variables etc
' experimental for Font "Arial" and family
Fh=1.55 ' ratio between fontsize and lineheight
Fw=1.05 'ratio between string width and requirded sign-width
'baseline etc to be added
END DEF
'
[–––––––––––––––––––––––– Functions ––––––––––––––––––––––––
F#(n)
shorthand function for number format
return number n as formatted text
local format string F$ should be set before use
default F$="0.0"
–––
End of function description –––––––––––]
'
[–––––––––––––––––––––– Implementation ––––––––––––––––––––––]
DEF F#(n) ' format number 
IF F$="" THEN F$="0.0"
  RETURN (STRTEXT n F$)
END DEF

It is still a long way to go

Post Reply