How to Clear variables

163 views
Skip to first unread message

Gamiz Ribelles, Sergi (Regsa)

unread,
Apr 26, 2011, 12:50:33 PM4/26/11
to mapi...@googlegroups.com
I know, I ought to know how to clear (erase) variables, but I can't find it. I want to clear the variable itself not only its content.
please, any help
Thank you

Sergi Gàmiz Ribelles

Thomas Bacon

unread,
Apr 26, 2011, 1:00:21 PM4/26/11
to mapi...@googlegroups.com

Sergi,

 

I don’t think you can clear a variable from memory in MapBasic.  I’m pretty sure the allocated memory is released when the sub procedure completes (or module if it is defined outside of a sub procedure).  I assume global variables remain in memory until the program terminates. Perhaps someone with a bit more knowledge might be able to clarify whether this is the case or not; I’m working off assumptions here!

 

HTH,

 

Tom Bacon

Graduate GIS Engineer

Asset Management South

Tel: 01444 472380

www.mouchel.com

 




The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX Registered No : 1686040

--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

Erin Comparri

unread,
Apr 26, 2011, 1:03:28 PM4/26/11
to mapi...@googlegroups.com
You'll want the UnDim feature. 
UnDim x

That should do it :)

-Erin

--

Thomas Bacon

unread,
Apr 26, 2011, 1:07:00 PM4/26/11
to mapi...@googlegroups.com

Shows how much I know. =(

 

Tom Bacon

Graduate GIS Engineer

Asset Management South

Tel: 01444 472380

www.mouchel.com

 

Erin Comparri

unread,
Apr 26, 2011, 1:07:54 PM4/26/11
to mapi...@googlegroups.com
The caveat here is that this cant be used in a compiled mbx.  I'm curious about why you want to delete a variable.

-Erin

Gamiz Ribelles, Sergi (Regsa)

unread,
Apr 26, 2011, 1:24:13 PM4/26/11
to mapi...@googlegroups.com
Of Coooooooooourse: UnDim!!!!!!!!!!
In MapBasic Reference Guide, t the end of DIM Statement description, there is the seccion "See also" where doesn't appear "UnDim"
 
Erin: I needed UnDim statement because I wrote in the past a litle tool that define some variables and I'm using it recursively.

Sergi Gàmiz Ribelles (627481954)
REGS DE CATALUNYA S.A. (www.regsa.cat)
Unitat de Promoció de Regadius i Concentració Parcel·lària
c/General Brito, 6, 5è
25007 Lleida
tel. 973222838   fax 973222627
sga...@regsa.cat

 


De: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] En nombre de Erin Comparri
Enviado el: martes, 26 de abril de 2011 19:08
Para: mapi...@googlegroups.com
Asunto: Re: [MI-L] How to Clear variables

Spencer Simpson

unread,
Apr 26, 2011, 1:31:03 PM4/26/11
to mapi...@googlegroups.com

Sounds like you've dim'ed some variables at the wrong scope.   Move the appropriate Dim statement(s) into the routine called recursively. 

 


Spencer


phamkhai tan

unread,
Apr 26, 2011, 9:52:08 PM4/26/11
to mapi...@googlegroups.com
Hi Gamiz, Sergi!

You can update "" in it's field



2011/4/26 Gamiz Ribelles, Sergi (Regsa) <sga...@regsa.cat>
--
Reply all
Reply to author
Forward
0 new messages