Lighten up fellows, he did say newbie, we all had to learn and I thought this forum was about helping people learn the power of PB
Rod
#DIM ALL
#DEBUG ERROR ON ..... ON ERROR GOTO ERRORTRAP ... ResumePoint: ... EXIT FUNCTION ERRORTRAP: MSGBOX USING$ ("Oops_! Error # &", ERR, ERROR$(ERR)), %MB_ICONHAND, "Programmer Error" RESUME ResumePoint
REDIM PRESERVE WORDS(1,[B]3[/B])[B] '<-- Dimmed to 3[/B] words(0,3) = 4 MSGBOX STR$(Words(0,1)) DO WHILE [B]iI < 5[/B] Words(1,iI)=10 + iI '[B]<-- When iI = 4 creates a BOUNDS ERROR[/B]
#DEBUG ERROR ON ' NB #INCLUDE "WIN32API.INC" Function PbMain() Local count As Long, sMessage, sArr As String Dim Ians() As String ON ERROR GOTO ErrorTrap Redim Ians(3) ' change to(4) to avoid out of bounds * For count = 0 To 4 '* <- goes out of bounds! Ians(count) = "Ians(" + format$(count) + ")" Next sMessage = Ians(0) & $CRLF & Ians(1) + $CRLF + Ians(2) + $CRLF + Ians(3) _ + $CRLF + Ians(4) '* <- out of bounds! MsgBox sMessage Exit Function ErrorTrap: MsgBox "Error! " + STR$(ERR) +" "+ ERROR$ ERR=0 Resume Next ' continue execution at line after error End Function '------------------/PBMain
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: