Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
Hi
I'm currently making a schoolproject and I'm stuck with reading an array into the possible options of a menu dialog. What I mean is: I've put some values into an array, I want all these values from the array to be possible to be selected in the menu. I'm npot sure how many options should be available, so i use the array length. Please help
I'm programming in Debian and I use bash.
Thanks
variables:
array muzieklijst[]
mpg123 is for playing the song
- Relevant commands, code, scripts, algorithms:
dialog --menu "title" width height optionsammount\
option1 \
option 2 \
option 3 \
...
- The attempts at a solution (include all code and scripts):
dialog --menu "Choose song" 25 75 ${#muzieklijst[@]} \
for j in $(`cat muzieklijst.txt`) ; do
echo ""$j" \\"
done 2> outputspeler.txt
for (( i=0; i<${#muzieklijst[@]}; i=$i=1))
do
if [ "$muzieklijst" = `cat outputspeler.txt` ]
then
mpg123 muziekpadlijst[$i]
continue
fi
done
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Odisee Technologiecampus Ghent, Ghent, Belgium, Joris Maervoet, B-ODISEE-JLW375-1718
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
---------- Post updated at 04:58 PM ---------- Previous update was at 04:41 PM ----------
I have to add, that I'm allowed to get help if I write where I got help from.