如何將NumberEditBox中的使用者輸入限制為7位數?ECN = 0,
Text Box( "System ECN:" ),
S1 = Number Edit Box(ECN, <<SET property=""></SET>
The user shouldn't be able to enter more than 7 digits. For example: 1234567... the user shouldn't be able to enter 8.
How did achieve this?
Any help is appreciated.
<LINGO-LABS id="lingo-labs-750800" slang="en-US" mode="CREATE"><LINGO-LABEL>數據探索和視覺化</LINGO-LABEL><LINGO-LABEL>視窗</LINGO-LABEL></LINGO-LABS>回覆:如何將 NumberEditBox 中的使用者輸入限制為 7 位數字?此版本要求使用者提交號碼的變更。
Names Default to Here( 1 );
last = eon = 0;
New Window( "Only Seven",
Outline Box( "Enter EON",
Line Up Box( N Col( 2 ),
Text Box( "System EON:" ),
neb = Number Edit Box( eon,
<< Set Integer Only( 1 ),
<< Set Minimum( 0 ),
<< Set Tip( "Enter an integer number with no more than 7 digits"),
<< Set Function( // called when user commits data entry
Function( { self },
new = self << Get;
If( Length( Char( new ) ) > 7,
self << Set( last ),
last = new
);
);
)
)
)
)
);回覆:如何將 NumberEditBox 中的使用者輸入限制為 7 位數字?嗨@PunitPanjwani
這是腳本索引中 set numberchanged() 和 getnumberchanged() 範例的修改版本。我認為這會讓你非常接近你的目標:
Names Default To Here( 1 );
New Window( "Example",
numBox = Number Edit Box(
.,
10,
<< set number changed(
Function( { thisBox, value }, /* put my value into my sibling's display */
if( length( char( value ) ) > 7,
// > 7 digits
thisBox << set( . );
( thisBox << sib ) << settext( "Too many digits" ),
// <= 7 digits
( thisBox << sib ) << settext( char( value ) )
)
)
)
),
Text Box( "" )/* here's the sibling box, waiting to show a message */
);
numBox << get number changed()
回覆:如何將 NumberEditBox 中的使用者輸入限制為 7 位數字?您在哪裡找到此訊息:
<< Set Max Length(7) // Limit the number of digits to 7
我在數位編輯框的協議中沒有看到它。
回覆:如何將 NumberEditBox 中的使用者輸入限制為 7 位數字?謝謝馬克!
我修改了程式碼如下所示,但仍然沒有成功。你認為JMP軟體中它很重要嗎?
Names Default to Here( 1 );
last = eon = 0;
New Window( "Only Seven",
Outline Box( "Enter EON",
Line Up Box( N Col( 2 ),
Text Box( "System EON:" ),
neb = Number Edit Box( eon,
<< Set Integer Only( 1 ),
<< Set Minimum( 0 ),
<< Set Tip( "Enter an integer number with no more than 7 digits")
<< Set Number Changed(
Function( { self, number },
If( Length( Char( number ) ) > 7,
self << Set( last ),
last = number
);
);
),
<< Set Max Length(7) // Limit the number of digits to 7
)
)
)
)回覆:如何將 NumberEditBox 中的使用者輸入限制為 7 位數字?你可以從這個方向開始。
Names Default to Here( 1 );
last = eon = 0;
New Window( "Only Seven",
Outline Box( "Enter EON",
Line Up Box( N Col( 2 ),
Text Box( "System EON:" ),
neb = Number Edit Box( eon,
<< Set Integer Only( 1 ),
<< Set Minimum( 0 ),
<< Set Tip( "Enter an integer number with no more than 7 digits")
<< Set Number Changed(
Function( { self, number },
If( Length( Char( number ) ) > 7,
self << Set( last ),
last = number
);
);
)
)
)
)
)