Excel
Posted: Wed Mar 10, 2021 10:48 am
Hi, I have a simple problem that's bugging me I'm trying to take an excel file onto my code and then place the values into separate array's. I've tried a bunch of different things and can't work it out any help would be appreciated. Here is my code if it helps.
on mouseup
// Get qualifying athletes' data
local arrayEntryID, arrayL0cation, arrayForename, arraySurname, arrayJumps, arrayAthleteStats
// Generate bib values and write to new file with entry IDs
local arrayWord1, arrayWord2, arryASCIIValue
// Find the highest number of jumping jacks completed
local maxJumps, MaximumIndex
// Display the full name of the athlete(s) who completed the highest number of jumping jacks
initialise
getDetails arrayEntryID, arrayL0cation, arrayForename, arraySurname, arrayJumps, arrayAthleteStats
GenerateBib arrayEntryID, arrayL0cation, arrayForename, arraySurname, arrayJumps, arrayWord1, arrayWord2, arryASCIIValue
FindHighestJump arrayJumps, arraymaxJumps, MaximumIndex
DisplayResults arraymaxJumps, arrayForename, arraySurname, arrayJumps
Test1
end mouseup
on initialise
local loop
// initialse parameters
repeat with loop = 0 to 30
put "" into arrayEntryID[loop]
put "" into arrayL0cation[loop]
put "" into arrayForename[loop]
put "" into arraySurname[loop]
put 0 into arrayJumps[loop]
put 0 into arraymaxJumps[loop]
put 6 into Test1
end repeat
end initialise
on getDetails @entryID, @l0cation, @forename, @surname, @jumps, @arrayAthleteStats
// enter athletes dta and store in appropriate variables
local useFile
local loop
answer file "please select the file with the athletes data."
if the result is not cancel then
put it into useFile
put url("file:" & useFile) into arrayAthleteStats[loop]
end if
repeat with loop = 0 to 30
put (field A of arrayAthleteStats[loop])into arrayEntryID[loop]
put (field B of arrayAthleteStats[loop]) into arrayL0cation[loop]
put (field C of arrayAthleteStats[loop])into arrayForename[loop]
put (field D of arrayAthleteStats[loop]) into arraySurname[loop]
put (field E of arrayAthleteStats[loop]) into arrayJumps[loop]
end repeat
end getDetails
on mouseup
// Get qualifying athletes' data
local arrayEntryID, arrayL0cation, arrayForename, arraySurname, arrayJumps, arrayAthleteStats
// Generate bib values and write to new file with entry IDs
local arrayWord1, arrayWord2, arryASCIIValue
// Find the highest number of jumping jacks completed
local maxJumps, MaximumIndex
// Display the full name of the athlete(s) who completed the highest number of jumping jacks
initialise
getDetails arrayEntryID, arrayL0cation, arrayForename, arraySurname, arrayJumps, arrayAthleteStats
GenerateBib arrayEntryID, arrayL0cation, arrayForename, arraySurname, arrayJumps, arrayWord1, arrayWord2, arryASCIIValue
FindHighestJump arrayJumps, arraymaxJumps, MaximumIndex
DisplayResults arraymaxJumps, arrayForename, arraySurname, arrayJumps
Test1
end mouseup
on initialise
local loop
// initialse parameters
repeat with loop = 0 to 30
put "" into arrayEntryID[loop]
put "" into arrayL0cation[loop]
put "" into arrayForename[loop]
put "" into arraySurname[loop]
put 0 into arrayJumps[loop]
put 0 into arraymaxJumps[loop]
put 6 into Test1
end repeat
end initialise
on getDetails @entryID, @l0cation, @forename, @surname, @jumps, @arrayAthleteStats
// enter athletes dta and store in appropriate variables
local useFile
local loop
answer file "please select the file with the athletes data."
if the result is not cancel then
put it into useFile
put url("file:" & useFile) into arrayAthleteStats[loop]
end if
repeat with loop = 0 to 30
put (field A of arrayAthleteStats[loop])into arrayEntryID[loop]
put (field B of arrayAthleteStats[loop]) into arrayL0cation[loop]
put (field C of arrayAthleteStats[loop])into arrayForename[loop]
put (field D of arrayAthleteStats[loop]) into arraySurname[loop]
put (field E of arrayAthleteStats[loop]) into arrayJumps[loop]
end repeat
end getDetails