OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Savesettings error in other language versions (http://forum.oberonplace.com/showthread.php?t=7571)

runflacruiser 15-03-2011 08:42

Savesettings error in other language versions
 
Hi.
I've recently had 2 users with the same problem. It seems savesettings is causing an error on their computer. I thought maybe it was a permissions problem until 2 users had the same problem. Does VBA save to the same directory no matter what the Windows/CorelDraw version?
Both users had showed me a screenshot and I did notice they use commas instead of periods for their language in the textboxes of the macro. Could this cause an issue?
Any other ideas?
Thanks.
-John

shelbym 15-03-2011 11:45

Commas
 
Yep, you have nailed it. Some languages will use a comma and not a period and things go wrong from there. You read in the value (a string), and convert to a double (CDbl) is see the comma and your get the error. If you are going to support International, you need to use (Val) first then (CDbl)

-Shelby

runflacruiser 15-03-2011 12:29

Hi.
This sub triggers the error handler in both cases.
Would that make this sub throw the error? Or is there also something else to blame?

Code:


Public Sub saveSettings()
    Dim fLeft As Double, fTop As Double
   
  On Error GoTo saveSettings_Error

    fLeft = frmMain.Left
    fTop = frmMain.Top
   
   
   
    SaveSetting "GDG_Nest", "Preferences", "form_left", fLeft
    SaveSetting "GDG_Nest", "Preferences", "form_top", fTop

    SaveSetting "GDG_Nest", "Preferences", "rand_use_h", frmMain.rdRandUseH.Value
    SaveSetting "GDG_Nest", "Preferences", "rand_use_w", frmMain.rdRandUseW.Value
   
    SaveSetting "GDG_Nest", "Preferences", "resp_area", frmMain.chkRespArea.Value
    SaveSetting "GDG_Nest", "Preferences", "leave_orig", frmMain.chkLeaveOrig.Value
    SaveSetting "GDG_Nest", "Preferences", "prec", frmMain.txtPrec
    SaveSetting "GDG_Nest", "Preferences", "ph", frmMain.txtH.Value
    SaveSetting "GDG_Nest", "Preferences", "margin", frmMain.txtMarg
    SaveSetting "GDG_Nest", "Preferences", "timer", frmMain.chkTimer.Value
    SaveSetting "GDG_Nest", "Preferences", "rotate45", frmMain.chkRot45.Value
    SaveSetting "GDG_Nest", "Preferences", "rotate", frmMain.chkRot.Value
    SaveSetting "GDG_Nest", "Preferences", "unit", frmMain.ComboBoxUnits.Value
    SaveSetting "GDG_Nest", "Preferences", "rotate", frmMain.chkRot.Value
    SaveSetting "GDG_Nest", "Preferences", "pw", frmMain.txtW.Value
    SaveSetting "GDG_Nest", "Preferences", "opt", frmMain.chkOpt.Value
   
   
    SaveSetting "GDG_Nest", "Preferences", "mode1", frmMain.rdModeNew.Value
    SaveSetting "GDG_Nest", "Preferences", "mode2", frmMain.rdModeAdd.Value
    SaveSetting "GDG_Nest", "Preferences", "mode3", frmMain.rdModeQuickTile.Value
   
    SaveSetting "GDG_Nest", "Preferences", "rand_mx", frmMain.txtRandMx.Value
    SaveSetting "GDG_Nest", "Preferences", "rand_my", frmMain.txtRandMy.Value
    SaveSetting "GDG_Nest", "Preferences", "rand_pal", frmMain.cbRandPal.Value

  On Error GoTo 0
  Exit Sub

saveSettings_Error:

    MsgBox "Error"

-John


All times are GMT -5. The time now is 00:03.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com