Jump to content

IniWriteSection "Invalid Data Type"


 Share

Go to solution Solved by JonBMN,

Recommended Posts

My first question before I start posting code and whatnot, is on the IniWriteSection the Failure returns 0 and sets @error to 1 for an invalid data type. Can anyone help me figure out what this certain invalid data type is, because the helpfile does not explain this is huge detail (I'm passing a 2d array with key value pairs).

Edited by JonBMN
Link to comment
Share on other sites

  • Moderators

JonBMN,

The Help file defines the required data pretty clearly as:

 

"The data to write. The data can either be a string or an array. If the data is a string, then each key=value pair must be delimited by @LF. If the data is an array, the array must be 2-dimensional and the second dimension must be 2 elements."

So it is either:

"key1=value1" & @LF & "key2=value2" & @LF & "key3=value3"
or an array

[[key1, value1], [key2, value2], [key3, value3]]
If what are you using as data does not match one of those two requirements, it is invalid. What are you trying to use? :huh:

M23

Edit: I have just seen your edit - how do you construct this 2D array?

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Solution

I figured it out, I had been trying to write values with a 2d array like so:

$exampleArray[10][2]

 

Come to find out I had been trying to use a 2d array with:

#exampleArray[10][10]

 

That was what was creating the invalid data type error.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...