Your Products have been synced, click here to refresh
$$ NO, Initialise B_RES (aka Boolean Result) ASSIGN/B_RES=0 C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO, Is NinjaBadger a genius? $$ NO, Get the comment type (i.e. YESNO) as a string ASSIGN/COMTYPE=GETTEXT(190,0,{C1}) $$ NO, IF left part of that (as long as the number of charachters in the result) = the user selection, then it's a YES IF/LEFT(COMTYPE,LEN(C1.INPUT))==C1.INPUT ASSIGN/B_RES=1 END_IF/ COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO, B_RES
NinjaBadger, that's a quite beautiful solution - although more or less the same approach as I took in my 'hackish' solution!
I can see two problem with yours, though - if a language has a word for NO beginning with the word for YES (as in YES and YESNOT), or if the PC-DMIS translation calls the function ASK_FOR_YES_OR_NO in some language...
(none of them apply to my hack)
ASSIGN/V1=GETSETTING("LangStr(-9)") 'returns "&Yes" ASSIGN/V1=GETSETTING("LangStr(-10)") 'returns "&No"
Sub GetSettingLangStr() Dim oApp As PCDLRN.Application Dim oPart As PCDLRN.PartProgram Dim oCmds As PCDLRN.Commands Dim oCmd As PCDLRN.Command Dim i As Long Dim bRet As Boolean Dim sStr As String Dim Result As Variant On Error GoTo ErrCatcher Set oApp = CreateObject("PCDLRN.Application") Set oPart = oApp.ActivePartProgram Set oCmds = oPart.Commands oApp.Visible = False For i = -1 To -1000 Step -1 Set oCmd = oCmds.Add(ASSIGNMENT, True) oCmd.Marked = True bRet = oCmd.PutText("V4", DEST_EXPR, 0) sStr = "GETSETTING(" & Chr(34) & "LangStr(" & i & ")" & Chr(34) & ")" bRet = oCmd.PutText(sStr, SRC_EXPR, 0) Set oCmd = oCmds.Add(SET_COMMENT, True) oCmd.Marked = True bRet = oCmd.PutText("", ID, 0) bRet = oCmd.SetToggleString(2, COMMENT_TYPE, 0) sStr = Chr(34) & i & ": " & Chr(34) bRet = oCmd.PutText(sStr, COMMENT_FIELD, 1) sStr = Chr(34) & i & ": " & Chr(34) & "+V4" Result = oCmd.SetExpression(sStr, COMMENT_FIELD, 1) Next i oApp.Visible = True oPart.RefreshPart ExitSub: Set oCmd = Nothing Set oCmds = Nothing Set oPart = Nothing Set oApp = Nothing Exit Sub ErrCatcher: MsgBox ("Error: " & Err.Number & vbCrLf & "Description: " & Err.Description) On Error GoTo 0 Resume ExitSub End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |