"Strong Type" Variable

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

"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: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: "Strong Type" Variable

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
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: "Strong Type" Variable

Post by srvet_claudio »

Hi,
see doc: Advanced --> Check Type
http://www.hmgforum.com/hmgdoc/data/index.htm
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: "Strong Type" Variable

Post 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
have fun
Jimmy
Post Reply