We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LDArray extension
#11
Hi,

1] You have to add the items in a loop one at a time, or if they can be set from an existing SB array (LDList.CreateFromIndices or LDList.CreateFromValues) or from a file (LDList.Read), so it depends on the source of the data for the list.

2] When an item is added to the List it is appended to the end.  Internally the items in a list are re-ordered as the list changes, so the indices always run from 1 to LDList.Count.
Reply
#12
(translated by Google translator)

Yumda,
I can suggest one more way how you can add several words to the list at once.
This can be done using the LDList.Append(listName1, listName2) method.
This method adds the second list to the end of the first list.

Shy
Reply
#13
so, if I understand correctly the ldlist is like creating a text file say --- vocablist, and within that file it contain the data or words in this case, am I correct to visualise like this? The trouble for me is that if I can not understand the logic I just could not utilise it. And the indices would be the order of the words in the file...

Am I correct by thinking it like this?
Reply
#14
Hi, LDList uses the C# List object.  You can't loads of info on it by googlung, "C# List".  For example https://www.c-sharpcorner.com/article/c-sharp-list/

Also you could look at the source code I use in LD extension.

Ultimately these give the full definition, the other way is to experiment with it and ask questions with specific example code you are working on that doesn't behave as you would want.
Reply
#15
(translated by Google translator)

I like the name "List".  Shy

This name creates the correct image.
Here is the list:
  1. Bla-bla
  2. Bla-bla-bla
  3. Ha-ha-ha-ha-ha
Everything is clear here. It is simple and convenient.
The indices are the line numbers.

Cool
[-] The following 1 user Likes AbsoluteBeginner's post:
  • litdev
Reply
#16
Yumda says:

so, if I understand correctly the ldlist is like creating a text file say --- vocablist, and within that file it contain the data or words in this case, am I correct to visualise like this? The trouble for me is that if I can not understand the logic I just could not utilise it. And the indices would be the order of the words in the file...

Am I correct by thinking it like this?

Yumda,

Yes you are correct. It is just lines of text with the indexes in front of them. Here is a code snippet to see how it works.

filepath="c:\temp\myfolder\myfile.txt"
name="myList"
LDList.Add(name,"Dog")
LDList.Add(name,"cat")
LDList.Add(name,"Rat")
LDList.Print(name)
LDList.write(name,filepath,"False")

'Then look in the filepath and you will see your list as a .txt file

I hope this helps!

JR
[-] The following 1 user Likes jrmrhrb00's post:
  • litdev
Reply
#17
Lots of Thanks to AbsoluteBeginner, Litdev and jrmrhrb00 for all your help. A new learning curve, but I got it.

Thanks!!!

regards
Reply
#18
(Yesterday, 12:22 AM)Yumda Wrote: Lots of Thanks to AbsoluteBeginner, Litdev and jrmrhrb00 for all your help.  A new learning curve, but I got it.

Thanks!!!

regards

We are glad that everything worked out for you.  Shy

We wish you good luck.  Wink
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)