Pcopy in PB? 
Author Message
 Pcopy in PB?

I need help how to replace QBasic PCOPY in Power Basic.
I have my source in QB but I need to  convert it to PB.
Anybody help ?

Dusan,




Sat, 08 Jun 2002 03:00:00 GMT  
 Pcopy in PB?

Quote:

>I need help how to replace QBasic PCOPY in Power Basic.
>I have my source in QB but I need to  convert it to PB.
>Anybody help ?

For which screen mode(s)?

This, if I remember correctly, will work for color text mode.

DIM Scrn_PTR(8) AS STRING PTR * 4000
Scrn_PTR(0) = &h0000B800
FOR X% = 1 TO 8
  Scrn_PTR(X%) = Scrn_PTR(X%-1) + &h00000100
NEXT

So....

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sun, 09 Jun 2002 03:00:00 GMT  
 Pcopy in PB?
Barry Erick wrote a PCOPY routine for powerbasic/DOS some years
back.... I seem to recall that it was merged into QuickPac Pro for
PowerBASIC.

I'll see if I can find it and post it here.  

Quote:

>I need help how to replace QBasic PCOPY in Power Basic.
>I have my source in QB but I need to  convert it to PB.
>Anybody help ?

>Dusan,



Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Sun, 09 Jun 2002 03:00:00 GMT  
 Pcopy in PB?


Quote:

>>I need help how to replace QBasic PCOPY in Power Basic.
>>I have my source in QB but I need to  convert it to PB.
>>Anybody help ?

>For which screen mode(s)?

>This, if I remember correctly, will work for color text mode.

Yes, I need this for color text mode.
Thank you for help.

Dusan.


HamCall: YT1DL

Quote:

>DIM Scrn_PTR(8) AS STRING PTR * 4000
>Scrn_PTR(0) = &h0000B800
>FOR X% = 1 TO 8
>  Scrn_PTR(X%) = Scrn_PTR(X%-1) + &h00000100
>NEXT

>So....


>   ____    _    ____      ____  _____
>  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

>  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
>  ___________________________________   www.basicguru.com
>      Vertical Software Solutions



Sun, 09 Jun 2002 03:00:00 GMT  
 Pcopy in PB?

Quote:

>I need help how to replace QBasic PCOPY in Power Basic.
>I have my source in QB but I need to  convert it to PB.
>Anybody help ?

I KNEW I'd done this code before! (Old age creeping up on me quickly)

Here's the code from my web pages. Enjoy!

-----------------
  Don Schullian

$if 0
Hi,

  Qbasic has a command to copy the contents of one video page into
another page, if the screen supports more than one page. This file
shows two different ways to do this in FirstBASIC and PowerBASIC
for VGA color screens.

  There are a total of 8 pages for text mode (25rows x 80columns).
You can access these pages either as Active or Visual or both using
the SCREEN Statement. The third parameter you pass sets the Active page.
This means that all out put (PRINT) goes to this page. The forth
parameter sets the Visual page. This is the one you see on your screen.

  So, this all means that you can write to the Apage while viewing the
Vpage then, when you've got the data on the Apage ready you can either
set the Vpage to match the Apage or copy the contents from the Apage
to the Vpage. This makes for smooth window popping. You copy your Apage
to one of the other pages, build your window, print the data THEN pop
it onto the Vpage.

  Another tricky thing you can do is save the data from the Vpage to
one of the other pages, pop a window, then copy the stored data back
to the Apage when you close the window! There are seven extra pages
and not too many programs get 7 windows deep. Because you're using
memory that is already allocated you are also not using any available
RAM or disk space to store the image of your Apage.

  One thing you'll want to think about before you embark on any of these
tricks is to assign pages numbers for particular tasks then stick to the
plan! Say, page 0 is your Vpage at all times. You use page 7 to do your
window work and pages 1 thru 6 to store the images. It will look some-
thing like this:

  LastUsedPage% = 0
  LastUsedPage% = LastUsedPage% + 1
  Copy page 0 to LastUsedPage%              >>--\
  Copy page 0 to page 7                         |
  Draw your window box and put in the data      |
  Copy page 7 to page 0                         |
    Do whatever is necessary with the window    |
  Copy LastUsedPage% to page 0              <<--/
  LastUsedPage% = LastUsedPage% - 1

Enjoy,

Don

$endif

'==========================================================================
'====== test code for TPageCopy
'==========================================================================

%DoYouHavePB32 = -1                           ' make this 0 if not
                                              '
'--------------------------------------------------------------------------
                                              ' set-up test conditions
CLS                                           ' for both systems
PRINT "Hello World"                           ' print test string to page 0
SCREEN ,,1,0                                  ' set active page to #1
CLS                                           ' clear active page
PRINT STRING$(1990,65);                       ' print to active page
SCREEN ,,0,0                                  ' set active page to #0
DELAY 1                                       ' dramatic pause
                                              '
'-------------------------------------------------------------------------
                                              '
$if %DoYouHavePB32                            ' using pointers with PB32
                                              '
  DIM VP_ptr(7) AS STRING PTR * 4000          ' one pointer for each page
  VP_ptr(0) = pbvScrnBuff                     ' page 0 at SEGMENT &h0800
  FOR P% = 1 TO 7                             ' lay in values for other
    VP_ptr(P%) = VP_ptr(P%-1) + &h01000000    '  pages
  NEXT                                        '
                                              '

                                              '
$else '-------------------------------------------------------------------
                                              '
CALL TPageCopy( 1, 0 )                        ' call the SUB routine
                                              '
SUB TPageCopy( FromPage%, ToPage% ) PUBLIC    ' copy text pages
  LOCAL Scrn$                                 '
                                              '
  DEF SEG = &hB800 + ( FromPage% * &h0100 )   ' SEGment for from page
  Scrn$   = PEEK$( 0, 4000 )                  ' read the data
  DEF SEG = &hB800 + ( ToPage% * &h0100 )     ' SEGment for to page
  POKE$ 0, Scrn$                              ' write the data
  DEF SEG                                     ' restore data segment
                                              '
END SUB                                       '
                                              '
$endif '------------------------------------------------------------------



Sun, 09 Jun 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. PB 3.2.PB/Vision 2.0 Timerinstallcode.Shared Arrays

2. MX Lookup with PB/CC or PB/DLL

3. TCPADDR for PB/DLL & PB/CC

4. Info on new PB/CC and PB/DLL

5. Announcing the JazzAge COM Wizard for PB/DLL and PB/CC

6. animated characters, speech input/output in PB/DLL and PB/CC

7. email enable PB/DLL-PB/CC using Outlook

8. SQL, ADO/OLE-DB programming in PB/DLL and PB/CC

9. PB/DLL question: pb-function that returns a record... HOW?

10. new JA 'CE' for PB/DLL, PB/CC OpenBeta3

11. Pb : too many open streams

12. Pb with a Case-Like Structure and Cmd-Line Input

 

 
Powered by phpBB® Forum Software