"Strong Type" Variable

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 794
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 111 times
Been thanked: 199 times

"Strong Type" Variable

Post by AUGE_OHR »

hi

in Source of MiniGUI Extended Version i found this Syntax

Code: Select all

LOCAL cOldLine AS STRING
LOCAL lResp AS LOGICAL
LOCAL nLine AS NUMERIC
LOCAL aControlS1 AS Array
so harbour / HMG can use "Strong Type" for Variable :o

what Type is

Code: Select all

LOCAL A2 AS USUAL
are there any Sample with "compare" Speed of "Strong Type" Variable :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 794
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 111 times
Been thanked: 199 times

Post by AUGE_OHR »

hi,

i found c:\MiniGUI\SAMPLES\Advanced\StronglyTypedVars\demo.prg

it seems me to "check" Type of Variable and will fail when mismatch.
i have try

Code: Select all

PUBLIC cImage

CHECK TYPE SOFT ;
   cImage AS CHARACTER        ,;
   xxx
and got Error
CHECK TYPE ( Param # 1 ) : cImage is declared as CHARACTER but it is of type LOGICAL. Program terminated
:o ... hm ... after change to

Code: Select all

PUBLIC cImage := ""
it does start Code without Error.
but when run that Modul it seems not to "change Speed".

do i use it wrong Way :idea:
is it just to "check" Type of Variable or are they real used :?:

p.s. i use HMG not Extended Version
have fun
Jimmy

Post Reply