Thursday, October 14, 2010

pb6 how to get the number of characters in the string?


Q: How to get the number of characters in the string?
A: Find a piece of code, you can get the number of character strings,
For i = 1 to Len (aString)
ls_ch = Mid (aString, i, 1)
If Asc (ls_ch)> = 128 then / / is the character
li_num + +
i = i +1
End if
Next

Finally, li_num is the number of Chinese characters, you can try.

Q: I need my PB to achieve the cycle time can click on the button and then exit the loop? As in the VB in the same cycle using DoEvent achieve?

A: This, of course use the Yield () function of. Such as:
integer n
//sb_interrupt 鏄叡浜彉閲?br />sb_interrupt = false
for n = 1 to 3000
yield()
if sb_interrupt then
/ / Sb_interrupt the value of "Cancel" button's Clicked event for the true changes
messagebox ("people quit," "You're bad!")
sb_interrupt=false
exit
else
/ / Other processing, the single-line editor displays the current value of n
sle_1.text = string (n)
//....
end if
next






相关链接:



H.264 To AVI



DreamweaverMX build Guestbook (4)



To people as a mirror: China 3G forget peace of mind



Negative comments: the right decision, "patron saint"



Wizard Audio And Multimedia



SANDISK to promote large-capacity iPod MP3 strong words



Struts framework in the SESSION object to create and control



PICKED Audio Recorders



Extreme Programming (eXtreme Programming) Summary



d3drm dll is missing In vista easy fix



Dynamic Power-BIV5.3.1 Chi Aowei smooth fat version!



3GPP to WMV



TS to MPG



MBS 2007 fiscal year have something to say



The fate of Sina and Sohu, Sina too POOR to only ads



No comments:

Post a Comment