PDA

View Full Version : سوال: تابع



ali340361
شنبه 16 مرداد 1389, 19:28 عصر
چگونه مي توان يک نتيجه يک تابع در يک تکست باکس در فرم را به وسيله متغيرهاي همان تکست باکس بدست اورد.
مثلا متغيرهاي يک تابع را در همان تکست باکسي که نتيجه تابع نمايش داده مي شود وارد کرد که نياز به تکست باکسهاي ديگر نباشد.
با تشکر خواهشمندم جواب دهيد و در صورت امکان نمونه ضميمه کنيد .

smderfan
سه شنبه 19 مرداد 1389, 22:28 عصر
سلام
براي اين كار شما مي تونيد از متغييرهاي حافظه استفاده كنيد و نتيجه رو مثلا با زدن اينتر در اون متغيير قرار بديد سپس نتيجه تابع رو در تكست باكس مورد نظر بفرستيد.


' AnyValue and MyValue are declared as Variant by default with values
' set to Empty.
Dim AnyValue, MyValue

' Explicitly declare a variable of type Integer.
Dim Number As Integer

' Multiple declarations on a single line. AnotherVar is of type Variant
' because its type is omitted.
Dim AnotherVar, Choice As Boolean, BirthDate As Date

' DayArray is an array of Variants with 51 elements indexed, from
' 0 thru 50, assuming Option Base is set to 0 (default) for
' the current module.
Dim DayArray(50)

' Matrix is a two-dimensional array of integers.
Dim Matrix(3, 4) As Integer

' MyMatrix is a three-dimensional array of doubles with explicit
' bounds.
Dim MyMatrix(1 To 5, 4 To 9, 3 To 5) As Double

' BirthDay is an array of dates with indexes from 1 to 10.
Dim BirthDay(1 To 10) As Date

' MyArray is a dynamic array of variants.
Dim MyArray()

ali340361
شنبه 23 مرداد 1389, 17:17 عصر
سلام
براي اين كار شما مي تونيد از متغييرهاي حافظه استفاده كنيد و نتيجه رو مثلا با زدن اينتر در اون متغيير قرار بديد سپس نتيجه تابع رو در تكست باكس مورد نظر بفرستيد.


' AnyValue and MyValue are declared as Variant by default with values
' set to Empty.
Dim AnyValue, MyValue

' Explicitly declare a variable of type Integer.
Dim Number As Integer

' Multiple declarations on a single line. AnotherVar is of type Variant
' because its type is omitted.
Dim AnotherVar, Choice As Boolean, BirthDate As Date

' DayArray is an array of Variants with 51 elements indexed, from
' 0 thru 50, assuming Option Base is set to 0 (default) for
' the current module.
Dim DayArray(50)

' Matrix is a two-dimensional array of integers.
Dim Matrix(3, 4) As Integer

' MyMatrix is a three-dimensional array of doubles with explicit
' bounds.
Dim MyMatrix(1 To 5, 4 To 9, 3 To 5) As Double

' BirthDay is an array of dates with indexes from 1 to 10.
Dim BirthDay(1 To 10) As Date

' MyArray is a dynamic array of variants.
Dim MyArray()



با تشکر از جوابي که داديد
ولي اگر امکان دارد يک نمونه ضميمه ارسال کنيد تا بهتر متوجه بشوم
با تشکر فراوان

ali340361
یک شنبه 31 مرداد 1389, 14:28 عصر
از راهنمائي شما متشکرم
ولي خواهش مي کنم يک نمونه مثلاً يک جمع ساده را در برنامه قرار دهيد .
باز هم خواهش فراوان دارم .