FoxPro® function:

The FoxPro® function right() returns the right part of a string. The function receives the string and the number of characters to return from the end of the string. If the number of chars you enter is longer than the string, the function returns the string. To determine the length of a string use len(string).
Parameters:
1. string2. number of characters to return from the end of the string
***************************** | |
* Tool&Task example program * | |
* right() * | |
* last compile: 24.11.2021 * | |
***************************** |
local lstring, lx, ly, ldist, ltake, llines | |
lstring = "drawing 'Hello'" | |
llen = len(lstring) | |
lx = 3 |
&& to explain the function |
ly = 3 |
&& |
ldist = 17 | |
ttg_new() |
&& clear TTG globals |
ttg_createbmp(148,148, FORMCOLOR) |
&& RGB(255,243,197) |
ttg_font('G', 'Courier New', 9, '000', 100, 300, BLUE) | |
ttg_fontselect('G') |
&& 'G' is not used by a printlist |
llines = int(llen/2) |
&& loop counter is integer |
if llines # llen/2 |
&& if llen is a odd number |
llines = llines + 1 |
&& otherwise the last char is missing |
endif | |
ltake = 2 |
&& 2 more each line |
for ln = 1 to llines |
&& this will show all pairs of chars |
ttg_text(lx, ly, right(lstring, ltake)) | |
ltake = ltake + 2 |
&& 2 more chars next line |
ly = ly + ldist |
&& move top of line |
endfor | |