It means "If variable is defined then you can use it but if not then you can Dim it here" This is handy for include files.
Fof example my favourite multipurpose varaibles are Helpb As Byte or Helpw As Word so probably they are in my main code already but if you want to be sure that included part of the code will compile then you can add "If varexist("Helpw") ...#Else Dim Helpw As Word #Endif.
But this can also be used for some uC compatibility. You can check if uC have "Tifr" only or "Tifr2" for example because they are defined in the DAT files
It originates from use within libs, where the user can define a variable, which can alter or extend code functionality, without having to alter the lib.
Code for a var called 'ABC' for example may only be implemented by conditional compiler directive if this variable actually exists by user-declaration, that's the varexist()'s purpose.
Else, it may be little known, that despite its name varexist() this function can be used also with constants.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum