Author Topic: TAB key trick help  (Read 3782 times)

0 Members and 1 Guest are viewing this topic.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
TAB key trick help
« on: March 12, 2021, 10:54:32 pm »
using the _clipboard$ I am capturing data

but like addresses, id/pw first name last name etc... etc.. i want to be able to store it in a string then past it to a windows form (from console)

I tried data$ + chr$(9) + data$, but this does exactly that, tabs over x amount of spaces.
then tried data$ + chr$(13)+chr$(10)+data$ still does not work

keeping it simple first name (tab) last name in forms, how can this be accomplished in qb64?

thanks
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 316
  • Needle nardle noo. - Peter Sellers
    • View Profile
Re: TAB key trick help
« Reply #1 on: March 13, 2021, 12:00:13 am »
I'm guessing you want things to "line up".  How about this approach?

Code: QB64: [Select]
  1. namef$ = "Humphrey"
  2. namel$ = "Bogart"
  3. outline$ = SPACE$(120)
  4. MID$(outline$, 1) = namel$
  5. MID$(outline$, 20) = namef$
  6. PRINT outline$
  7.  
It works better if you plug it in.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: TAB key trick help
« Reply #2 on: March 13, 2021, 12:44:37 am »
This will lineup vertically:
Code: QB64: [Select]
  1. oneString$ = "Humphrey Bogart" + Chr$(10) + "6310 Rogerton Dr." + Chr$(10) + "Los Angeles, California"
  2. Print oneString$
  3.  

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: TAB key trick help
« Reply #3 on: March 13, 2021, 07:56:09 am »
my fault...
Those you guys suggested works perfect - in notepad or any other notepad like app

Go to a webpage form
When you paste it just puts it all on the text box

so it does FIRSTNAME                       LASTNAME
instead of

FIRSTNAME
LASTNAME
 Hope that makes sense  lol
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: TAB key trick help
« Reply #4 on: March 13, 2021, 11:28:54 am »
I have no idea the structure of a Web Page Form but we haven't tried Mid$() statement on a fixed string
redim as string * alot myRecord
mid$(myRecord, 1,  maxFirstName) = firstName
mid$(myRecord, maxFirstName+1, maxLastname) = lastName
mid$(myRecord,
ect...

probably be better to have fixed field length too then field# could be used to position everything. That would cycle us back to R Frost post only more intelligently.


Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: TAB key trick help
« Reply #5 on: March 13, 2021, 11:33:51 am »
hmmm

think of it like this site qb64.org

when you log in, you have two text boxes

id and pw

if you use a chr$(10)+chr$(13) (or vs) it only paste in the first text box, instead of separating the two (id first box and then tabs over to put the pw. can never get that to work.)

But that is ok, I was checking lastpass for a reference, and it allows you to copy pw/id separately... so might stick with that method. I don't think it is possible in QB to  a "tab over" method

I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: TAB key trick help
« Reply #6 on: March 13, 2021, 11:40:51 am »
You probably need to pass a simulated keypress or mouse click or combo, as if the user is typing the thing in real time.

Qb64 has that in it's magic bag of tricks, the Command names were not memorized by me but maybe @Pete or @SMcNeill or @FellippeHeitor would know or search keywords by context.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: TAB key trick help
« Reply #7 on: March 13, 2021, 11:42:46 am »
You probably need to pass a simulated keypress or mouse click or combo, as if the user is typing the thing in real time.

Qb64 has that in it's magic bag of tricks, the Command names were not memorized by me but maybe @Pete or @SMcNeill or @FellippeHeitor would know or search keywords by context.

ya that would be perfect, I was trying to find that last night. I did not want to pass the actual asc(), but a simulated "tab", however  Ifeel I am chasing a rabbit ahah!
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: TAB key trick help
« Reply #8 on: March 13, 2021, 11:46:11 am »
He's talking about an input form on a webpage or similar program. When you press the TAB-Key, then the cursor usually jumps to the next input field, so you don't need to select it via mouse. Now he @xra7en expects the same thing to happen with inserting TAB codes (chr$(9)) into his clipped string to distribute the strings into the various input fields.

No idea if this works with CLIPBOARD$, maybe you should rather try _SCREENPRINT
http://www.qb64.org/wiki/SCREENPRINT
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: TAB key trick help
« Reply #9 on: March 13, 2021, 11:56:33 am »
Yep! _ScreenPrint that was what I was trying to recall, thanks @RhoSigma

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: TAB key trick help
« Reply #10 on: March 13, 2021, 02:02:20 pm »
Sorry I was late to the party. I've done this before with _SCREENPRINT CHR$(9), but that's already been mentioned.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: TAB key trick help
« Reply #11 on: March 13, 2021, 02:22:06 pm »
Sorry I was late to the party. I've done this before with _SCREENPRINT CHR$(9), but that's already been mentioned.

Pete

Ya does not work as an assignment with clipboard.

Not a huge deal, was just getting picky LOL, I like to push QB sometimes.

My app just copies the data to the clipboard and then I can paste it when I need. Just thought it would be pretty slick if i could paste and fill out a form from a clipboard.

not a setback :-)

I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!