QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: xra7en on March 12, 2021, 10:54:32 pm

Title: TAB key trick help
Post by: xra7en 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
Title: Re: TAB key trick help
Post by: Richard Frost 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.  
Title: Re: TAB key trick help
Post by: bplus 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.  
Title: Re: TAB key trick help
Post by: xra7en 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
Title: Re: TAB key trick help
Post by: bplus 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.

Title: Re: TAB key trick help
Post by: xra7en 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

Title: Re: TAB key trick help
Post by: bplus 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.
Title: Re: TAB key trick help
Post by: xra7en 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!
Title: Re: TAB key trick help
Post by: RhoSigma 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
Title: Re: TAB key trick help
Post by: bplus on March 13, 2021, 11:56:33 am
Yep! _ScreenPrint that was what I was trying to recall, thanks @RhoSigma
Title: Re: TAB key trick help
Post by: Pete 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
Title: Re: TAB key trick help
Post by: xra7en 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 :-)