--------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1X00002 Date: 01/25/98 From: BARRY ERICK Time: 09:38am \/To: ALL (Read 1 times) Subj: Re: Sub's Or defining Pro From: "Barry Erick" Subject: Re: Sub's Or defining Procedures Peter, You need to do this: a$=LEFT(b$,1) changeletter a$ SUB changeletter(b$) if b$ = "a" then c$ = c$+"z" if b$ = "b" then c$ = c$+"y" 'etc. etc. ' now, to return c$ in b$ b$= c$ 'because c$ is local... else make c$ SHARED or PUBLIC so it will show above END SUB Or, as a function a$ = Left$(b$,1) PRINT ChangedLetter$(a$) FUNCTION ChangedLetter$(b$) if b$ = "a" then c$ = c$+"z" if b$ = "b" then c$ = c$+"y" 'etc. etc. ChangedLetter$=c$ END FUNCTION Peter.waller wrote in message <01bd28b3$02c89a00$0100000a@viglen>... |Hallo There, (If This Question has been asked before DONT BLAME ME BECAUSE |I am 11 Years Old!!!) |Erm, I Have been Trying To Define a procedure that will detect a letter and |change it To the opposite letter. |I would like to call it like this: | | |a$=LEFT(b$,1) |run proc changeletter a$ | |PROC changeletter |if b$ = "a" then c$ = c$+"z" |if b$ = "b" then c$ = c$+"y" |etc. etc. |END proc | |What is the Problem, | |Please explain | |Thanx |Pete | |-- |Please remove NS from reply address if you |wish to reply |in other words reply to peter.waller@btinternet.com *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1X00003 Date: 01/25/98 From: MARC VAN DEN DIKKENBERG Time: 09:17pm \/To: ALL (Read 1 times) Subj: PB REG / inline ASM probl From: pb@excelsior.xs4all.nl.REMOVE-THIS (Marc van den Dikkenberg) Subject: PB REG / inline ASM problems I've converted a fully functional set of IPX network routines from QB to PB. I've tried two different ways of implementing it in PB, but there is one major problem: either it works under win95, or it works under DOS. Not both of them... Of course these days, that's not quite acceptable, and I'm trying to figure out how to get this to work under BOTH operating systems, like the original QuickBasic source does... Is there anyone who knows what might be the problem? Here's the SUB that causes the problems... Original QB code (works fine under both DOS and Win95) *** SUB SendPacket (CompleteCode%, InUseFlag%) InReg.BX = 3 InReg.ES = VARSEG(ECBS) InReg.SI = VARPTR(ECBS) CALL InterruptX(&H7A, InReg, OutReg) CompleteCode = ASC(ECBS.CompCode) InUseFlag = ASC(ECBS.InUse) END SUB *** PB Code. Works find under DOS, crashes under Win95 *** SUB SendPacket (CompleteCode%, InUseFlag%) Reg 2, 3 Reg 9, VARSEG(ECBS) Reg 5, VARPTR(ECBS) CALL INTERRUPT &H7A CompleteCode = ASC(ECBS.CompCode) InUseFlag = ASC(ECBS.InUse) END SUB *** Alternative PB Code. Works fine under Win95, locks up under DOS. *** SUB SendPacket (CompleteCode%, InUseFlag%) print "I'm starting" plop%=varseg(ECBS) plip%=varptr(ECBS) ! MOV BX,3 ! MOV ES,plop% ! MOV SI,plip% ! INT &H7A CompleteCode = ASC(ECBS.CompCode) InUseFlag = ASC(ECBS.InUse) print "I'm done" END SUB *** The weird thing, is that this sub is completed completely: the text "I'm done" appears on the screen. However, the program locks up completely. The very next line after calling the SendPacket SUB is "BEEP", and some print statements. None of these happen... Trying to use WORDS instead of integers (plop??) has exactly the same result. Works under Win95, locks up under DOS. As you understand, this is getting quite frustrating... any ideas, anyone? -- Marc van den Dikkenberg ----------------------- The PowerBasic Archives http://www.xs4all.nl/~excel/pb.html *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1X00004 Date: 01/26/98 From: BARRY ERICK Time: 07:39am \/To: ALL (Read 1 times) Subj: Re: PB REG / inline ASM p From: "Barry Erick" Subject: Re: PB REG / inline ASM problems Is your ECBS block SHARED, or PUBLIC? How is the Sub getting that? Trace through in the IDE or Debugger, and use ALT 7 to bring up the CPU registers and also watch the ECBS variable to make sure it is appearing in the SUB. --- Barry Marc van den Dikkenberg wrote in message <34cbab8d.956284@news.xs4all.nl>... | |I've converted a fully functional set of IPX network routines |from QB to PB. I've tried two different ways of implementing it in PB, but |there is one major problem: either it works under win95, or it works under |DOS. Not both of them... Of course these days, that's not quite acceptable, |and I'm trying to figure out how to get this to work under BOTH operating |systems, like the original QuickBasic source does... | |Is there anyone who knows what might be the problem? |Here's the SUB that causes the problems... | | |Original QB code (works fine under both DOS and Win95) |--- |SUB SendPacket (CompleteCode%, InUseFlag%) | InReg.BX = 3 | InReg.ES = VARSEG(ECBS) | InReg.SI = VARPTR(ECBS) | CALL InterruptX(&H7A, InReg, OutReg) | CompleteCode = ASC(ECBS.CompCode) | InUseFlag = ASC(ECBS.InUse) |END SUB |--- | | |PB Code. Works find under DOS, crashes under Win95 |--- |SUB SendPacket (CompleteCode%, InUseFlag%) | Reg 2, 3 | Reg 9, VARSEG(ECBS) | Reg 5, VARPTR(ECBS) | CALL INTERRUPT &H7A | CompleteCode = ASC(ECBS.CompCode) | InUseFlag = ASC(ECBS.InUse) |END SUB |--- | | |Alternative PB Code. Works fine under Win95, locks up under DOS. |--- |SUB SendPacket (CompleteCode%, InUseFlag%) | print "I'm starting" | plop%=varseg(ECBS) | plip%=varptr(ECBS) | ! MOV BX,3 | ! MOV ES,plop% | ! MOV SI,plip% | ! INT &H7A | CompleteCode = ASC(ECBS.CompCode) | InUseFlag = ASC(ECBS.InUse) | print "I'm done" |END SUB |--- | |The weird thing, is that this sub is completed completely: the text "I'm |done" appears on the screen. However, the program locks up completely. The |very next line after calling the SendPacket SUB is "BEEP", and some print |statements. None of these happen... Trying to use WORDS instead of integers |(plop??) has exactly the same result. Works under Win95, locks up under |DOS. | |As you understand, this is getting quite frustrating... |any ideas, anyone? | |-- |Marc van den Dikkenberg |----------------------- |The PowerBasic Archives |http://www.xs4all.nl/~excel/pb.html *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1X00005 Date: 01/24/98 From: DON SCHULLIAN Time: 05:06am \/To: ALL (Read 1 times) Subj: Re: Any way to block or c From: d83@ath.forthnet.gr (Don Schullian) Subject: Re: Any way to block or column select ? On 23 Jan 1998 00:54:03 GMT, greeb@screamingmonkey.com (Jim Greeb) wrote: >Help !! > > I am trying to implement a feature known as a "block" or >"column" select. In this mode, a drag of the cursor selects across >lines without continuing to the end of the line before moving >down.... like this: > >xxx x xxxxx x xxxxxxx XXXX XXXX x xx xxx xxx xxxxx xxxxxxxx >x xxxxxx xx xxxxxx x X XXX XXX xx xxx xxxxxxxxxx x xxxxxxx >xx xxxxx x xxx x xx x XXX XXX X x xxxxxx x xxx x xxxxxxxxxx >x xx x xxxxxx xx xxxx XXXXX XXX x Sure, this doesn't sound too difficult if I understood you correctly.. You need to capture the starting X,Y postion of the cursor and let's store them in X1 and Y1 then, keep track of the cursor's movement in a loop using X2 and Y2 If X2 or Y2 become smaller than X1 and Y1 respectivly then swap the values When the 'release' is signaled you should have the x1,y1,x2,y2 for your block The sub would look something like this... SUB CaptureText ( X1%, Y1%, X2%, Y2% ) ' return values in the parameters WhereIsCursor X1%, Y1% X2% = X1% Y2% = Y1% DO PaintBox X1%, Y1%, X2%, Y2%, HiliteAttr WhereIsCursor X%, Y% PaintBox X1%, Y1%, X2%, Y2%, NormAttr X2% = X% Y2% = Y% IF X2% < X1% THEN SWAP X1%, X2% IF Y2% < Y1% THEN SWAP Y1%, Y2% LOOP UNTIL Released END SUB ____ _ ____ ____ _____ | _ \ / \ / ___) __ | ___)(_ _) | |_) / _ \ \____\/ \| _) | | |____//_/ \_\(____/\__/|_| |_| Reply to: d83@ath.forthnet.gr www.basicguru.com/schullian *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1X00006 Date: 01/26/98 From: DON SCHULLIAN Time: 04:43pm \/To: ALL (Read 1 times) Subj: Printing in MS-DOS window From: d83@ath.forthnet.gr (Don Schullian) Subject: Printing in MS-DOS window under WT95 Hi, For 2 days now I've been trying to track down an intermittant error in a ew print routine I was putting together. It seemed that when/if I attempted to send any commands after I'd started printing and the printer was still working on a page that the command would be sent, the skipped ver and the subsiquent character(s) printed then printing would be halted without finishing the assigned task! Anyhow, all this was going on in a WinTrash DOS window and, after some SERIOUS verbage and masterful mouse clicking I __THINK__ I've found the ource of my (windoze's) problem... You have to: open the control pannel click on the 'printers' icon (R)click on your printer icon Click on 'Properties' Click on 'Details' Click on 'Port Settings' Turn OFF 'Spool MS-DOS Print Jobs' Close 'er down Arrrrrrrrggggggggggggggg!!!!!! ____ _ ____ ____ _____ | _ \ / \ / ___) __ | ___)(_ _) | |_) / _ \ \____\/ \| _) | | |____//_/ \_\(____/\__/|_| |_| Reply to: d83@ath.forthnet.gr www.basicguru.com/schullian *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1X00007 Date: 01/26/98 From: WIEBE ZOON Time: 07:12pm \/To: ALL (Read 1 times) Subj: Re: File existence From: "Wiebe Zoon" Subject: Re: File existence Austin Bordeaux <"Austin Bordeaux"> > heeft geschreven in bericht <34C7A29B.20A9@ibm.net>... >I'm using PB3.00c. Can't figure a way to check for existence of a >random access file. another way to accomplish the same thing is to open a file for input. If it doesn't exist, PB will generate an error. *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1^00000 Date: 01/26/98 From: DAVE NAVARRO Time: 02:43pm \/To: ALL (Read 1 times) Subj: Re: passing doubles to a From: dave@powerbasic.com (Dave Navarro) Subject: Re: passing doubles to a PB .DLL In article <33F8E23B9399AAA0.E79908A89937612D.1A4500561EF3D5FD@library- proxy.airnews.net>, salinon1@airmail.net says... > Hi- > > I have the PB DLL compiler v1.5 and I'm using VB4/16 bit. How can I > pass double precision variables to and from a PB DLL sub? It doesn't > seem to work like passing integers and my manual only shows how to do it > via functions NOT subs. > ex. Call PBSUB(D1, D2) 'where D1, D2 are doubles SUB PBSUB (d1 AS DOUBLE, d2 AS DOUBLE) EXPORT ' your code here END SUB 'VB Declare Declare Sub PBSUB Lib "PB.DLL" (d1 As Double, d2 As Double) --Dave *** QwkNews (tm) v2.1 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/561) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F1^00001 Date: 01/26/98 From: MARC VAN DEN DIKKENBERG Time: 10:57pm \/To: ALL (Read 1 times) Subj: Re: PB REG / inline ASM p From: pb@excelsior.xs4all.nl.REMOVE-THIS (Marc van den Dikkenberg) Subject: Re: PB REG / inline ASM problems On Mon, 26 Jan 1998 07:39:29 -0500, "Barry Erick" wrote: >Is your ECBS block SHARED, or PUBLIC? How is the Sub getting that? Trace >through in the IDE or Debugger, and use ALT 7 to bring up the CPU registers >and also watch the ECBS variable to make sure it is appearing in the SUB. > --- Barry DIM ECBS AS SHARED ECBStructure The variables I feed into it contain the data alright, or it wouldn't work anywhere - that's what puzzling me. I knew that REG has odd behaviour while running Win95, but I understood that inline ASM shouldn't be a problem. Works fine with Win95, but locks up in DOS. Hm... just checking: what datatype are VARSEG and VARPTR supposed to contain? I assumed WORD. Same question for the various CPU registers... Maybe I'm running out of certain boundaries here... I can imagine that the memory locations where stuff is stored would be different when running Win95 then running plain DOS... -- Marc van den Dikkenberg