hexagon logo

TRACEFIELD Scripting Modification

http://www.pcdmisforum.com/showthread.php?27544-Tracefields-and-Scripts&highlight=tracefield+script

Long time lurker and PC-DMIS user, first time posting - and going to get deep here...
Did some searching, and the most similar topic to what I've been looking for is above.

However, what I need is to temporarily - or for one TRACEFIELD item - define the object as a numeric value (Integer preferably...) instead of a String value.

I'm wondering how to pull this off elegantly? I'm somewhat new to scripting but have dabbled scripting in Excel, Access, etc. in the past. Mostly editing and not inventing the wheel, so-to-speak.

I really need to figure out a way to do this or I'll go insane trying - and breaking -stuff. Slight smile

I was thinking of just copying the command and inserting a new assignment for the TRACE_VALUE field, but not sure if that will work. I'm looking for advice here since I don't want to do more harm than good.

Thanks for any help!

Set DmisCommand = DmisCommands.Add(TRACEFIELD, True)
    DmisCommand.Marked = True
  ' Set Name  = Job
    retval = DmisCommand.PutText ("Job", TRACE_NAME, 0)
  ' Set Value  = 0
    retval = DmisCommand.PutText ("0", TRACE_VALUE, 0)
  ' Set Value Limit  = 15
    retval = DmisCommand.PutText ("15", TRACE_VALUE_LIMIT, 0)
  Result = DmisCommand.SetExpression("C2.INPUT", TRACE_VALUE, 0)


I believe I found that TRACE_VALUE is Dim'd as String. I need it to be Integer for one value and String for all others.

Edited to add that it's ok if the value is Long or Double or Integer - as long as it's numeric....
Parents
  • Hmmm, at first I was sated (and disappointed), but I still wonder if that is necessarily true. If I know for a fact that Datapage will not accept the type as numeric, then I guess I'm at a standstill.

    However, I still believe that the defining of the field at the TRACEFIELD level is what stops me. There may be a possibility that Datapage "reads" whatever is in that field when generated and then passes it on. I don't know how to "view" the hierarchy of Datapage at this juncture... But if I try executing the script as I'd like to do, it will either accept it or it won't, and I have my answer. At this point, I'm stubborn enough to need to run it and prove it doesn't work before I concede impossibility.
Reply
  • Hmmm, at first I was sated (and disappointed), but I still wonder if that is necessarily true. If I know for a fact that Datapage will not accept the type as numeric, then I guess I'm at a standstill.

    However, I still believe that the defining of the field at the TRACEFIELD level is what stops me. There may be a possibility that Datapage "reads" whatever is in that field when generated and then passes it on. I don't know how to "view" the hierarchy of Datapage at this juncture... But if I try executing the script as I'd like to do, it will either accept it or it won't, and I have my answer. At this point, I'm stubborn enough to need to run it and prove it doesn't work before I concede impossibility.
Children
No Data