キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

scan from string error 85

解決済み
解決策を見る

I am having trouble using scan from string function. For some reason I can't separate the string from the number. I get error 85.

0 件の賞賛
メッセージ1/5
5,496件の閲覧回数

We can't really diagnose the problem if we don't know what's going into it...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 件の賞賛
メッセージ2/5
5,488件の閲覧回数

Appologies.

 

When input string is PID1234 I expect the following outputs:

String output = PID

Numeric output = 1234

 

Instead I get an error 85 

0 件の賞賛
メッセージ3/5
5,481件の閲覧回数
解決策
受理者 drakkar

%s is going to grab everything, instead grab the non-digits followed by a number using this format string : %[^0-9]%d

メッセージ4/5
5,473件の閲覧回数

Use "%[^0-9]%d" for your format string.  This will tell the first string output to stop when it finds a number.

 

EDIT: Well, better late than never...



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
メッセージ5/5
5,467件の閲覧回数