Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

&= operation


  • Please log in to reply
6 replies to this topic

#1 XuxinhaKill

XuxinhaKill

    Seeker

  • Active Members
  • 32 posts

Posted 19 September 2012 - 09:31 PM

Can anyone tell me why am I getting this
[Posicoes] Vetor=76,,32,,102,,52,,180,,80,,273,,278,,294,,419,,94,,1066,,753,,1055,,447,,1061,,451,,1011,,502,,220,,97,,580,,150,,355,,7,,367,,20,,10,,17

from this code?
Local $oi = $vec[0] For $i = 1 to 28 Step +1 $oi &= "," & $vec[$i] Next IniWrite("Example.ini","Posicoes", "Vetor", $oi)

instead of this
[Posicoes] Vetor=76,32,102,52,180,80,273,278,294,419,94,1066,753,1055,447,1061,451,1011,502,220,97,580,150,355,7,367,20,10,17

Edited by XuxinhaKill, 19 September 2012 - 09:31 PM.








#2 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 11,221 posts

Posted 19 September 2012 - 09:35 PM

Sorry, I can't find my crystal ball,.

#3 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,636 posts

Posted 19 September 2012 - 09:36 PM

Firstly you don't need the step +1 as by default a For...Next loop increases by 1 anyway. Secondly, I don't know what the array $vec contains, but look a the code below to give you an idea.

Local $sOutput = '' For $i = 1 To 28     $sOutput &= Random(1, 50, 1) & ',' Next $sOutput = StringTrimRight($sOutput, 1); Trim the last , ConsoleWrite($sOutput & @CRLF)

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#4 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,636 posts

Posted 19 September 2012 - 09:37 PM

Or if you don't want to show us more, then use $oi = StringReplace($oi, ',,', ',')

Edited by guinness, 19 September 2012 - 09:38 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#5 Bowmore

Bowmore

    Feinschmecker

  • Active Members
  • PipPipPipPipPipPip
  • 831 posts

Posted 19 September 2012 - 11:02 PM

I'm only guessing what $vec contains but I suspect this might solve your problem.
Local $oi = $vec[0] For $i = 1 to 28 Step +1 $oi &= $vec[$i] Next IniWrite("Example.ini","Posicoes", "Vetor", $oi)

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

#6 XuxinhaKill

XuxinhaKill

    Seeker

  • Active Members
  • 32 posts

Posted 19 September 2012 - 11:49 PM

I'm only guessing what $vec contains but I suspect this might solve your problem.


I tried what you said and it worked, then I realized that the error wasnt in that part but the content of the array like you and guinness thought...
Thank you guys

Edited by XuxinhaKill, 19 September 2012 - 11:49 PM.


#7 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,636 posts

Posted 20 September 2012 - 11:31 AM

I tried what you said and it worked, then I realized that the error wasnt in that part but the content of the array like you and guinness thought...
Thank you guys

In the future it's best to post what you can, especially since the contents of $vec were important to solving your issue.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users