下列範例會以隨機模式開啟檔案。 檔案包含使用者定義型別的記錄。 VB複製 Type Record' Define user-defined type.IDAsIntegerNameAsString*20EndTypeDimMyRecordAsRecord' Declare variable.Open"TESTFILE"ForRandomAs#1 Len = Len(MyRecord) ' Close before reopening in another mode. Close #1 ...
此範例說明Lock和Unlock語句的使用方式。 當記錄正在修改時,其他進程對記錄的存取會遭到拒絕。 這個範例假設 是一個檔案,TESTFILE其中包含用戶定義型Record別 的五筆記錄。 VB複製 Type Record' Define user-defined type.IDAsIntegerNameAsString*20EndTypeDimMyRecordAsRecord, RecordNumber' Declare variables.' Open...
此範例會使用Type 語句來定義使用者定義的資料類型。Type 語句僅用於模組層級。 如果它出現在類別模組中,Type語句前面必須加上關鍵字Private。 VB複製 Type EmployeeRecord' Create user-defined type.IDAsInteger' Define elements of data type.NameAsString*20AddressAsString*30PhoneAsLongHireDateAsDateEndTypeSub...
' Define the 2D polyline points 定義 2D 點的座標 points(0) = 1: points(1) = 1 ' 第一點 x, y 座標 points(2) = 1: points(3) = 2 ' 第二點 x, y 座標 points(4) = 2: points(5) = 2 points(6) = 3: points(7) = 2 points(8) = 4: points(9) = 4 ' Create a light...
Sub Ch4_ChangeTextHeight() Dim textObj As AcadText Dim textString As String Dim insertionPoint(0 To 2) As Double Dim height As Double ' Define the text object textString = "Hello, World." insertionPoint(0) = 3 insertionPoint(1) = 3 insertionPoint(2) = 0 height = 0.5 ' Create the...
ヘルプのホームページ 日本語
此範例會使用 Get 語句,將檔案中的資料讀取到變數中。 此範例假設 TESTFILE 包含使用者定義型別五筆記錄的檔案是包含使用者定義型 Record別 之五筆記錄的檔案。VB 複製 Type Record ' Define user-defined type. ID As Integer Name As String * 20 End Type Dim MyRecord As Record, Position ' Declare ...
Type Record' Define user-defined type.IDAsIntegerNameAsString*20EndTypeDimMyRecordAsRecord, RecordNumber' Declare variables.' Open sample file for random access.Open"TESTFILE"ForRandomSharedAs#1 Len = Len(MyRecord) RecordNumber = 4 ' Define record number. Lock #1, RecordNumber' Lock record.Get...
Sub Ch4_ExplodePolyline() Dim plineObj As AcadLWPolyline Dim points(0 To 11) As Double ' Define the 2D polyline points points(0) = 1: points(1) = 1 points(2) = 1: points(3) = 2 points(4) = 2: points(5) = 2 points(6) = 3: points(7) = 2 points(8) = 4: points(9)...
#define _USE_MATH_DEFINES #include "math.h" //数学関数 #include "oleauto.h" //SAFEARRAY ●targetver.h #pragma once // 以下のマクロは、最低限必要なプラットフォームを定義します。最低限必要なプラットフォームとは、 // アプリケーションを実行するために必要な機能を備えた最も古...