Thanks to Ethan, Bill and Lars for getting back to me on this one.
 
The best way to go about this appears to be to place text objects on the layout 
that start with an @ character, search for these pieces of text, and then 
update the text with the values you want displayed on your layout.
 
What I cant work out is how do you take this a step forward, so that when 
someone reopens a saved workspace they can then use the mapbasic program to 
edit the values on the layout? The text objects on the layout will not start 
with an @ sign anymore, so how do you find them as you will not know what 
values have been placed in them by the user?
 
Regards,
 
James
 
  _____  

From: Ethan Hohneck [mailto:[EMAIL PROTECTED] 
Sent: 08 June 2006 02:53
To: James Stott
Cc: [email protected]
Subject: Re: [MI-L] Variables for filling out fields on a layout
 
Hi James
 
I have recently written a program that utilises a layout template with frames, 
symbols, and text objects.  The frames and text objects are all variables.  
Each with standard style attributes set in the layout.  The following code is 
one way in which you can select the text object variable and update it with 
your newly created variable.
 
UPDATE THE @DATE VARIABLE
 - strLayWinName is the variable set for the Layout
 - val(str$(objectinfo(object,1))) = 10 is the ObjectInfo TYPE for TEXT objects
 - str$(objectinfo(object,3)) = "@DATE" is the ObjectInfo TEXTSTRING for your 
variable in the layout "@DATE"
 - the selected text object "@DATE" is then stored as a layout object variable 
and then ALTERED with the new variable FormatDate$(CurDate()) then UPDATED
 
'========================================================================

 select * from strLayWinName where val(str$(objectinfo(object,1))) = 10 into 
strLaySel noselect
 select * from strLaySel where str$(objectinfo(object,3)) = "@DATE" into 
strLayObjSel
 
 oLayout = strLayObjSel.object
 alter object oLayout info 3, FormatDate$(CurDate()) 
 update selection set object = oLayout
 
'========================================================================
 
Good luck.
 
Cheers
Ethan
 
Ethan Hohneck
Systems Analyst
Digital Mapping Solutions
Level 2, 2 Hardy Street
South Perth WA 6151
Ph 08 9474 6311 
Fax 08 9474 6411 
www.mapsolutions.com.au <blocked::blocked::http://www.mapsolutions.com.au/>  | 
MapInfo Training <http://www.mapsolutions.com.au/services/training/index.html> 
| IntraMaps <http://www.mapsolutions.com.au/products/intramaps/index.html>  | 
InterMaps <http://www.mapsolutions.com.au/products/intermaps/index.html>  | 
MobileMap <http://www.mapsolutions.com.au/products/mobilemap/index.html>  | 
News <http://www.mapsolutions.com.au/news/index.html> 
 
Disclaimer
This email and any files transmitted with it are intended solely for the use of 
the individual or entity to whom they are addressed.  Although every effort has 
been made to ensure the correctness and integrity of attachments that may be 
included in this email, this can only apply to the unaltered/uncorrupted form. 
A copy of the original attachment is available from our office should you 
require it.  Alternately, if further verification is required please request a 
hard copy version.
 
Digital Mapping Solutions
 

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to