Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
IIF(RAT("*",TRANSFORM(ii,"@R **********")) > 0, LEFT(TRANSFORM(ii,"@R **********"),RAT("*",TRANSFORM(ii,"@R **********"))), TRANSFORM(ii,"@R **********"))
LPARAMETERS toFX, toListener, tcMethodToken,;
tP1, tP2, tP3, tP4, tP5, tP6,;
tP7, tP8, tP9, tP10, tP11, tP12
LOCAL lclc,tnPixels,tnPixels1,lnTwips,lcName,lnSize,lnFontSize
lnFontSize = 12 && the size used for asterisks. If you change the font size for this filed, change this value accordingly
IF RAT("*",TRANSFORM(ii,"@R **********")) > 0
* Extract the asterisks
lclc = TRANSFORM(ii,"@R **********")
* Calculate the width of the asterisks in pixels
lcName = _Screen.FontName && change the settings
lnSize = _Screen.FontSize
_Screen.FontName = "Courier New" && use the field font name and size
_Screen.FontSize = m.lnFontSize
tnPixels = _Screen.TextWidth(LEFT(m.lclc,RAT("*",m.lclc)+1)) && get the width of the asterisks in pixels
tnPixels1 = _Screen.TextWidth(LEFT(m.lclc,RAT("*",m.lclc)))
_Screen.FontName = m.lcName && restore the settings
_Screen.FontSize = m.lnSize
* Calculate the width of the asterisks in 1/960 inch (960 dpi)
LOCAL lnDeviceHandle, lnPixelsPerInch, lnTwips
* Declare the required API functions
DECLARE INTEGER GetDC IN USER32 AS GetDC INTEGER hwnd
DECLARE INTEGER ReleaseDC IN USER32 AS ReleaseDC ;
INTEGER hwnd, INTEGER hdc
DECLARE INTEGER GetDeviceCaps IN GDI32 AS GetDeviceCaps ;
INTEGER hdc, INTEGER nIndex
* Get a handle to the current device
lnDeviceHandle = GetDC(0)
* Get pixels per inch for the device in the
* specified direction
lnPixelsPerInch = ;
GetDeviceCaps(lnDeviceHandle, 88) && 88 width, 90 height
* Release the handle
lnDeviceHandle = ReleaseDC(0, lnDeviceHandle)
CLEAR DLLS "GetCD", "ReleaseDC", "GetDeviceCaps"
* Do the conversion
lnTwips = CEILING(m.tnPixels * 960 / m.lnPixelsPerInch) && 1440
* Change the with of the field to the newly calculated size
tp4 = m.lnTwips + m.lnFontSize
* Store the left position + the new width of this field into report variable nNewPos
* nNewPos will become the new left position of the other field (the one with digits)
* tP2 holds the left position and tP4 the width of the object. Both are passed by reference (can be changed)
nNewPos = m.tP2 + CEILING(tnPixels1 * 960 / lnPixelsPerInch) + 10
ELSE && when are no asterisks
nNewPos = m.tp2 && the other field will be placed over this one
tp4 = 1 && and this one will be not printed. I cannot use Print When, because it must be rendered. Also I can not use 0. But 1 means 1/960 of a inch
ENDIF
IIF(RAT("*",TRANSFORM(ii,"@R **********")) > 0, SUBSTR(TRANSFORM(ii,"@R **********"),RAT("*",TRANSFORM(ii,"@R **********"))+1), TRANSFORM(ii,"@R **********"))
tP2 = nNewPos && the newly left margin of the field