hexagon logo

IF_GOTO/C1.INPUT and multiple languages...

OK, I'm stumped (not really, but I would like a general solution).

If I have an IF_GOTO/C1.INPUT == "YES" in my program, it will break when I change PC-DMIS to Swedish.

So, I can write IF_GOTO/(C1.INPUT == "YES") or (C1.INPUT == "JA") to make it work in English and Swedish (and some more, like German).

But how do I write to have it work in the current language PC-DMIS is set to, whatever language that is?

In the Report Editor there's a function LOADSTR(xyz) which can get the current translation of string #xyz, but that doesn't work in a part program.
Parents
  • Not sure if this will help - you'll need to play around with it. It does prepend the returned value with an ampersand. Don't know if resource.dll would be better for you than strings.dll. The listing in online help doesn't seem to be complete. Entering some random numbers returned strings not listed.

    ASSIGN/V1=GETSETTING("LangStr(-9)")  'returns "&Yes"
    ASSIGN/V1=GETSETTING("LangStr(-10)")  'returns "&No"


    (from online help under String Functions):
    "LangStr(<Number or ID>Wink" – Returns a string from PC-DMIS's resources in the current language from a resource ID number or from one of these IDs:
    "Yes", "No", "Oper", "Rept", "Input", "Doc", "YesNo", "Readout", "Internal", "External", "Rect ", "Polr ", "Out", "In", "Least_Sqr", "Min_Sep", "Max_Insc", "Min_CircSc", "Fixed_Rad", "Workplane", "Xaxis", "YAxis", "ZAxis", "Xplus", "Xminus", "YPlus", "YMinus", "ZPlus", "ZMinus", "Point", "Plane", "Line", "Circle", "Sphere", "Cylinder", "Round_Slot", "Square_slot", "Cone", or "None".

    If the value you use is a positive number, PC-DMIS pulls the string from its resource.dll file. If you use a negative number, PC-DMIS pulls the string from its strings.dll file (the strings table).
Reply
  • Not sure if this will help - you'll need to play around with it. It does prepend the returned value with an ampersand. Don't know if resource.dll would be better for you than strings.dll. The listing in online help doesn't seem to be complete. Entering some random numbers returned strings not listed.

    ASSIGN/V1=GETSETTING("LangStr(-9)")  'returns "&Yes"
    ASSIGN/V1=GETSETTING("LangStr(-10)")  'returns "&No"


    (from online help under String Functions):
    "LangStr(<Number or ID>Wink" – Returns a string from PC-DMIS's resources in the current language from a resource ID number or from one of these IDs:
    "Yes", "No", "Oper", "Rept", "Input", "Doc", "YesNo", "Readout", "Internal", "External", "Rect ", "Polr ", "Out", "In", "Least_Sqr", "Min_Sep", "Max_Insc", "Min_CircSc", "Fixed_Rad", "Workplane", "Xaxis", "YAxis", "ZAxis", "Xplus", "Xminus", "YPlus", "YMinus", "ZPlus", "ZMinus", "Point", "Plane", "Line", "Circle", "Sphere", "Cylinder", "Round_Slot", "Square_slot", "Cone", or "None".

    If the value you use is a positive number, PC-DMIS pulls the string from its resource.dll file. If you use a negative number, PC-DMIS pulls the string from its strings.dll file (the strings table).
Children
No Data