CT83 Posted November 25, 2016 Share Posted November 25, 2016 Dir_Load("Target1", "GS1_TarToday", $GS1_TarToday) ;here Target1 is a dir. and GS1_TarToday is a filename. $GS1_TarToday is the edit box in which i want to display info set by dir_load function Func Dir_Load($cS_Group,$cS_Name,$cVData,$cSavedPath="Configurations\Default") Local $cCurrent_Path=String($cSavedPath&"\"&$cS_Group&"\"&$cS_Name&".ct83") Local $cFileData If Not _FileReadToArray($cCurrent_Path,$cFileData, 0) Then MsgBox($MB_SYSTEMMODAL, "", "There was an error Reading the "& $cS_Group&"\"&$cS_Name &".ct83 File ! Please Try again! ") EndIf Local $cFileData1 = _ArrayToString($cFileData) GUICtrlSetData($cVData,$cFileData1) Endfunc The above code is meant to set the data of the edit box to a file GS1_TarToday.ct83 in Target1 folder ( $cFileData1 ) but this code simply does nothing. No errors are returned. still the data of the edit box remains as it is, Link to comment Share on other sites More sharing options...
j0kky Posted November 25, 2016 Share Posted November 25, 2016 (edited) Add an error checking line after _ArrayToString call and see what happens: if @error then consolewrite("Error: " & @error & @crlf) Edited November 25, 2016 by j0kky Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
CT83 Posted November 25, 2016 Author Share Posted November 25, 2016 11 minutes ago, j0kky said: Add an error checking line after _ArrayToString call and see what happens: if @error then consolewrite("Error: " & @error & @crlf) Yip done that, Nope no errors returned and when i MsgBox the contents of variable $cFileData1 I correctly see them, in this case they are the digits "25" Link to comment Share on other sites More sharing options...
j0kky Posted November 25, 2016 Share Posted November 25, 2016 (edited) See the output of: consolewrite(GUICtrlSetData($cVData,$cFileData1) & @crlf) Anyhow, to help you, you should post the entire code, I think there is something wrong with $GS1_TarToday Edited November 25, 2016 by j0kky CT83 1 Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
InunoTaishou Posted November 25, 2016 Share Posted November 25, 2016 Check the contents of $cSavedPath&"\"&$cS_Group&"\"&$cS_Name&".ct83" Perhaps it's just full of white spaces and the edit control is being set properly. CT83 1 Link to comment Share on other sites More sharing options...
CT83 Posted November 25, 2016 Author Share Posted November 25, 2016 15 minutes ago, j0kky said: See the output of: consolewrite(GUICtrlSetData($cVData,$cFileData1) & @crlf) Anyhow, to help you, you should post the entire code, I think there is something wrong with $GS1_TarToday yeah i will post the entire code in a while ... btw consolewrite(GUICtrlSetData($cVData,$cFileData1) & @crlf) just returns "0" what should i be expecting? Link to comment Share on other sites More sharing options...
j0kky Posted November 25, 2016 Share Posted November 25, 2016 If it outputs 1 there was real a problem Now I'm quite sure the problem resides in $GS1_TarToday Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
CT83 Posted November 25, 2016 Author Share Posted November 25, 2016 (edited) 16 minutes ago, j0kky said: If it outputs 1 there was real a problem Now I'm quite sure the problem resides in $GS1_TarToday Yes you are right! and as it turns out $GS1_TarToday was the variable which stored text from $S1_TarToday and not the actual edit box . So all the time i was trying to set a entirely different variable. oh i am so embarrassed. Thanks for your help! You guys are awesome! Edited November 25, 2016 by CT83 Link to comment Share on other sites More sharing options...
InunoTaishou Posted November 25, 2016 Share Posted November 25, 2016 Maybe look into better naming conventions. $edtEdit, $sString, $aArray, etc Link to comment Share on other sites More sharing options...
CT83 Posted November 25, 2016 Author Share Posted November 25, 2016 3 minutes ago, InunoTaishou said: Maybe look into better naming conventions. $edtEdit, $sString, $aArray, etc yeah i guess... newbie here Link to comment Share on other sites More sharing options...
j0kky Posted November 25, 2016 Share Posted November 25, 2016 I'm glad it helped! Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now