zoukankan      html  css  js  c++  java
  • modPub.bas

    Attribute VB_Name = "modPub"
    Option Explicit

    Public strAppPath$
    Public intFontSize As Integer
    Public strFontColor As String
    Public lngFontColor As Long
    Public strSplit As String

    Sub Main()
        strAppPath = App.Path
        If Right(strAppPath, 1) <> "\" Then strAppPath = strAppPath & "\"
        iniFileName = strAppPath & "user.INI"
       
        If Dir(iniFileName) <> "" Then
            Call initFromIniFile
        Else
            Call initFromApp
            Call saveToIniFile
        End If
        Form1.Show
    End Sub
    '从配置文件初始化
    Private Sub initFromIniFile()
    '    On Error GoTo err1
        intFontSize = Trim(GetIniS("UserSet", "FontSize"))
        strFontColor = Trim(GetIniS("UserSet", "FontColor"))
        lngFontColor = Val(strFontColor)
        strSplit = Trim(GetIniS("UserSet", "Split "))
       
        Exit Sub
    err1:
        Call initFromApp
        Call saveToIniFile
    End Sub
    '保存到配置文件
    Public Sub saveToIniFile()
        SetIniS "UserSet", "FontSize", CStr(intFontSize)
        SetIniS "UserSet", "FontColor", CStr(strFontColor)
        SetIniS "UserSet", "Split", CStr(strSplit)
    End Sub
    '用程序自身初始化
    Private Sub initFromApp()
        intFontSize = 10
        strFontColor = "&HFFFF&"
        lngFontColor = Val(strFontColor)
        strSplit = "---------------------------------"
    End Sub

  • 相关阅读:
    python线程的几种创建方式
    python进程之间的通信——Queue
    python中进程的几种创建方式
    python中的生成器、迭代器、闭包、装饰器
    java中String和StringBuffer的区别
    python中的元类介绍
    宣传片制作技巧
    树莓派创建WiFi热点
    PCB布线要求
    jsoncpp linux平台编译和arm移植
  • 原文地址:https://www.cnblogs.com/sysdzw/p/1939402.html
Copyright © 2011-2022 走看看