Page 1 of 1

"Strong Type" Variable

Posted: Sat May 23, 2020 4:07 am
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 :?:

Re: "Strong Type" Variable

Posted: Sun May 24, 2020 5:01 am
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

Re: "Strong Type" Variable

Posted: Wed Jul 01, 2020 6:41 pm
by srvet_claudio
Hi,
see doc: Advanced --> Check Type
http://www.hmgforum.com/hmgdoc/data/index.htm

Re: "Strong Type" Variable

Posted: Wed Jul 01, 2020 7:22 pm
by AUGE_OHR
hi Claudio,
srvet_claudio wrote: Wed Jul 01, 2020 6:41 pm see doc: Advanced --> Check Type
http://www.hmgforum.com/hmgdoc/data/index.htm
thx for Answer.
when read i "think" it is "just" to check Type of Variable,
i have hope Code "run" faster when using strong Type

greetings by OHR
Jimmy