Help asked: systemRPL ^IFMain question
|
02-04-2016, 11:38 PM
Post: #6
|
|||
|
|||
RE: Help asked: systemRPL ^IFMain question
(02-04-2016 09:16 PM)brrm Wrote: When I worked on it I ran into another problem. CK&DISPATCH1 will do the conversion (as will CKREAL), but it also sets some other things that aren't desirable at the point in your code (protection word comes to mind). When I mentioned before that there was no error checking, this is part of what I was alluding to. Storing the value in the field in this manner bypasses the normal validation that IfMain does to make sure that the object is an acceptable type. It may be a better approach to use the IfCheckFieldtype function that is part of the InputForm API. While I haven't tried all possible combinations of objects and field types, it did at least appear to convert a ZINT to a REAL automatically in this situation. It also returns a boolean that allows you to branch accordingly if the type wasn't acceptable. When I was playing around with this earlier today, it seems that there's some fragility with this method of obtaining the data directly from the command line. I'm not sure, but I suspect that this comes from having several stacked "environments" active simultaneously. I tried the following code for the form's message handler and found that it was reasonably effective: Code: ' :: One of the potential problems that can occur is if the command line contains a string which will compile into multiple objects (ie. "123A" becomes % 123 and 'A' ). Things get a bit messier for that kind of scenario. Whatever you end up with, you'll want to run through a variety of scenarios to make sure it works the way you want. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Help asked: systemRPL ^IFMain question - brrm - 01-27-2016, 09:51 PM
RE: Help asked: systemRPL ^IFMain question - wojtek - 02-02-2016, 08:19 PM
RE: Help asked: systemRPL ^IFMain question - brrm - 02-03-2016, 09:23 AM
RE: Help asked: systemRPL ^IFMain question - DavidM - 02-04-2016, 01:58 AM
RE: Help asked: systemRPL ^IFMain question - brrm - 02-04-2016, 09:16 PM
RE: Help asked: systemRPL ^IFMain question - DavidM - 02-04-2016 11:38 PM
RE: Help asked: systemRPL ^IFMain question - brrm - 02-09-2016, 11:37 AM
RE: Help asked: systemRPL ^IFMain question - DavidM - 02-09-2016, 02:33 PM
|
User(s) browsing this thread: 1 Guest(s)