Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML in methods
Message
From
16/04/2002 04:10:54
 
 
To
16/04/2002 04:00:00
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00645319
Message ID:
00645322
Views:
27
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

Uff, this way is quite strange and unusual for VFP.

Forst of all, you have to forget about ReadMethod() use, because it is not available in run-time. As soon as your code will be compiled into the VFP EXE module, you will see this immediately. ReadMethod and WriteMethod methods exists for design time only - for class builders. Do not use it in the real code that will run on the client machine in the EXE - they will just not work.

What is wrong with the files approach? There are functions StrToFile() and FileToStr() that are quite simple in use.

You can assign the XML string to the property in run time. For example, your builder can add something like following to the Init method of the class:

this.InitialXMLString = ;
"<...>..." + ;
"<...>..." + ;
"<...>..." + ;
"<...>..." + ;
...
""

When class is used on the runnign form, above assignment will put XML into the property of the class. You can use it then as a string exactly the same way.

Keep methods of the class for VFP code only.

>Hi,
>
>I use the ReadMethod command (doesn't work with Readexpression and write expressions and a property) to read XML data directly from a method of a container class that acts as a User Interface Control.
>I do this because I want to keep this data, that is strictly linked to the class and only needed for UI purposes, contained in the VCX. In doing so, I don't need separated files. When an object of that class is instantiated, I pull the data from the method by using the Readmethod() command and can easily manipulate the data (e.g. XMLtoCursor).
>When I write the XML data into the method at DESIGN time, I simply ignore the error message.
>
>Now I'm building a builder to do the same thing (writemethod()command) and I want to suppress the error message (VFP doesn't interpret the XML as valuable command).
>I could write myself another equivalent to the readmethod or writemethod commands and manipulate the vcx files (which are in fact dbf files) but there has to be a more elegant way to do this.
>
>Can somebody help me with this?
>
>
>Mark.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform