2016년 12월 17일 토요일

AI2 - add tab in between 2 text (while creating a tab delimited text file)


I working on an app that writes 2 fields in a text file: eg
Barcode  Qty
"34234242342" "100"
"786786786786" "500"
"888578867867" "1000"

I need a tab in between barcode and qty so that file I am exporting can be used on a windows app.

I have already tried 5 and 8 blank spaces and used \n but not getting any resolution.

-- 

I need a tab in between barcode and qty 
as far as I know unfortunately it's not possible to get a tab in App Inventor

-- 
Actually it is possible but it cannot be done just with AppInventor. The problem is that typically the tab key has a special meaning on web pages, which is to go to the next focusable element, so when you attempt to type a tab into a text box, for example, it will focus on some other element. This behavior is not triggered if you paste the tab character from another program. It's possible to copy a tab character from your favorite text program (I used TextEdit.app on Mac) and paste it into a text field in App Inventor. I've attached the screenshot of the blocks I used and tested against three things: Label, Notifier, and File. Each seemed to show a wider than normal whitespace where the tab character is located. The text file contains ASCII value 9 (horizontal tab) at byte 4, so it's definitely ending up in the companion app. I did not test compiling the app, so it's possible there is differing behavior, but I think it is unlikely. Let us know if that works out for you.

-- 
Thanks Evan. You are a genius!!!. That was last puzzle in my app and your solution worked.

-- 
See attached for how to get a TAB character using the Web component and a html stunt.
From my CRLF app in the Gallery.
TAB.png 표시 중


-- 

댓글 없음:

댓글 쓰기