Skip to first unread message

Ghanem O

unread,
Nov 4, 2017, 11:11:22 PM11/4/17
to MIT App Inventor Forum

Hi everybody,
Please help me.
I cann't join two csv's in one csv.
There is one story in each .csv file and I want to make both of stories in only one csv.
So, the first story lay in row 1 and story 2 in row 2 in excel sheet and so on. 
Thx
1.png
2.png
3.png

TimAI2

unread,
Nov 5, 2017, 5:38:03 AM11/5/17
to MIT App Inventor Forum
What is the structure of your two csv files, assuming it is the same?

Number of columns / rows etc. or give an example?

Ghica

unread,
Nov 5, 2017, 9:25:58 AM11/5/17
to mitappinv...@googlegroups.com
Osama,
What are you thinking?

During Screen1.Initialize you first call ReadStory and then you set the elements of Select_Story
But, in ReadStory you use the selection index of a list you did not set yet (or maybe you did that in the design screen? In which case you should not set the elements in Screen1.Initialize),
From your blocks it is also not clear when you open Select_Story. It could be that this is a user interaction, in which case you should not call ReadStory during initialize at all, because you do not know yet which story to read.

Knowing the background of your question, I am wondering why you would want to combine 2 csv files at all. I think you should prepare them in advance.
Anyway, I think you do not want to continue this test app I made for you into something larger. What you do want is to replace the images in your complete app with text contained in csv files, about 600 of them, to be downloaded on demand from your Google drive.
Cheers, Ghica.

 


TimAI2

unread,
Nov 5, 2017, 10:07:00 AM11/5/17
to MIT App Inventor Forum
Been working on this for Ghanem O, having decided all the stories should be in one csv file, prepared in advance.

The csv needs to be transposed for easier selecting via indexes:


You can always prepare it the other way around then transpose the whole lot before exporting to csv


The attached aia and blocks below allow for a story to be selected by the listpicker, then the first line of the story is displayed, Buttons then allow for next page and previous page


Do not use the Filter Bar in the listpicker, otherwise you may lose the selection index for the story (well known bug)




Hope this is what you were after.


stories.aia
Message has been deleted

Ghanem O

unread,
Nov 5, 2017, 3:38:21 PM11/5/17
to MIT App Inventor Forum
Hi Tim,
I tried to construct it in my aia but there is the same result after select item.
Can you please help me.


Ghica

unread,
Nov 5, 2017, 5:19:19 PM11/5/17
to MIT App Inventor Forum
Osama,
As you wrote me, you want to write a new app, childrens stories instead of Quran text.
You are not allowed to use my test app (testArabicText) for that and I am certainly not going to tell you why the app you attached does not work. By the way, it will look really strange if you try it with Engish text.
Cheers, Ghica

TimAI2

unread,
Nov 5, 2017, 8:56:17 PM11/5/17
to MIT App Inventor Forum
Ghanem

The blocks and design in my aia work, please review them again and use them.

Also, please keep all communications on the forum, this makes it easier and less time consuming for moderators to help.
Thanks

Ghica

unread,
Nov 7, 2017, 11:46:10 AM11/7/17
to mitappinv...@googlegroups.com

>>
I tried to construct it in my aia but there is the same result after select item.
>>
Hints.
What will happen when you press select a story and you selected an iten. Which block will be executed? Hint: when Select_Story.AfterPicking
What does when Select_Story.AfterPickingWhat do? Hint: It calls ReadStory.
What does ReadStory do? Hint: it calls File1.ReadFrom filename "//stories.csv".
What will happen next? Hint: wait for when File1.GotText is called.
What does when File1.GotText do? Hint: it sets global listIndex to 1 and then calls setPage. with listIndex as argument.
What does setPage do? Hint: it sets the webviewstring, selecting a sory using index  1
Result: You will always get Story 1
See?

Now, throw this away and use Tim's example.
Cheers, Ghica.



Ghanem O

unread,
Nov 7, 2017, 2:39:53 PM11/7/17
to MIT App Inventor Forum
Hi Ghica,

Can you please check if there is another way by using webviewer. Because by using webviewr much better and more common.
The language of story will be in Arabic but I give an example just to let the people in the forum understand what do I need exatly.

Thank you.

Ghica

unread,
Nov 8, 2017, 8:38:00 AM11/8/17
to mitappinv...@googlegroups.com
Please do not address this to me personally, in order to encourage others to answer.
My answer is:
Do not worry about the webviewer, first make it work with a Label or Textbox. Then using a Webviewer instead is not difficult but you need knowledge of HTML, JavaScript and CSS to do it properly (it takes about 2 years to get that knowledge).
A label or textbox supports Arabic automatically, for a Webviewer you have to do something special, like coding the right HTML.
Although you would have more flexibility in the way you can show the output with a Webviewer, it is always wise to develop in steps and get the basics right first.
Cheers, Ghica


Ghanem O

unread,
Nov 9, 2017, 12:53:02 AM11/9/17
to MIT App Inventor Forum
Hi Ghica, 
Thank you so much for helping me. I want to learn more about Webviewer even if it would take 4 years to learn but my question is it possible to change Arabic Font type flexibility.

Thank you Ghica.

Ghica

unread,
Nov 9, 2017, 7:17:58 AM11/9/17
to MIT App Inventor Forum
https://www.w3schools.com/
Or search for some Arabic HTML/CSS course.
Cheers, Ghica
Reply all
Reply to author
Forward
0 new messages