الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

عندي مشكلة بسيطة في تفقيط المبلغ 8 و 800 ؟

بدأه Yousaf_Lnx في 4 مارس 2008 · 4 رد · 7,072 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

اسلام عليكم

عندي مشكلة في برامج الحسابات عندما يكتب الرقم 8 ثمانية يكتب صح و لكن عندما يكتب (800 ثمانيمائة فهذا غلط ) (صح هيا ثمانمائة)

ممكن حد يساعد؟

شكراً.......................................

المثال مرفق .

Example_1.zip

#2

اخوي جرب هذا

المثال

Numbers.rar

من قال فيني عيب والله ظلمني ×× فيني ثمان عيوب والتاسع الطيب

العاشر ليا من رفـيقي زهمني ×× اسوق له عمري واسوق المواجيب

#3

جرب هذا الكود - فهو يفقط حتى رقم 999999999 بدون اي خطا

Public Mony As Currency

Public Function Word3() As String

On Error GoTo My_Err

Dim ZZ, number, cnumber

Dim deci1 As Integer, deci2 As Integer, point As String

Dim ones As Integer, tens As Integer, huns As Integer

Dim thou As Integer, tent As Integer, hunt As Integer

Dim mlun As Integer, tenm As Integer, hunm As Integer

Dim Namones, Namtens, Namhuns

Dim Add1, Add2, Add3

Dim AN1, AN2, AN3, AN4, AN5, AN6, AN7, AN8, AN9, AN10

Dim deci1place, deci2place

Dim onesplace, tensplace, hunsplace

Dim thouplace, tentplace, huntplace

Dim mlunplace, tenmplace, hunmplace

Dim Type1, Type2

Dim A, B, C, C1, d, D1, E, E1, F, F1, G, G1, H, H1, i, I1, J, K, L, M, N, O, P, Q, R, s, T, U, V, W, X, Y, Z, ZA, ZB, ZC, ZD, ZE, ZF, ZG, ZH, ZI, AA, W3, W5

'********************************* My Chek ********************************

If Mony > 999999999.99 Then

Word3 = Mony

Exit Function

End If

'************************************************************************

number = Mony

cnumber = Format(number, "000000000.00")

'************************************************************************

A = "æÇÍÏ"

B = "ÅËäÇä"

C = "ËáÇËÉ"

C1 = "ËáÇËãÇÆå"

d = "ÃÑÈÚÉ"

D1 = "ÃÑÈÚãÇÆå"

E = "ÎãÓÉ"

E1 = "ÎãÓãÇÆå"

F = "ÓÊÉ"

F1 = "ÓÊãÇÆå"

G = "ÓÈÚÉ"

G1 = "ÓÈÚãÇÆå"

H = "ËãÇäíÉ"

H1 = "ËãÇäãÇÆå"

i = "ÊÓÚÉ"

I1 = "ÊÓÚãÇÆå"

J = "ÚÔÑÉ"

K = " ÚÔÑ"

L = "ÃÍÏ ÚÔÑ"

M = "ÅËäÇ ÚÔÑ"

N = "ÚÔÑæä"

O = "臂辊"

P = "ÃÑÈÚæä"

Q = "ÎãÓæä"

R = "ÓÊæä"

s = "ÓÈÚæä"

T = "ËãÇäæä"

U = "ÊÓÚæä"

V = "ãÇÆå"

W = "ãÇÆÊÇä"

X = "ÃáÝ"

Y = "ÂáÇÝ"

Z = "ÃáÝÇä"

ZA = "ãáíæä"

ZB = "ãáíæäÇä"

ZC = " æ "

ZE = " ÑíÇá"

ZF = "ÑíÇáÇä"

ZG = " åááÉ"

ZH = "åááÊÇä"

ZI = " åááÇÊ"

AA = " ÊÓÚÉ "

ZZ = " ÝÞØ áÇÛíÑ"

W3 = "ËáÇËÉ "

W5 = "ÎãÓÉ "

'************************************************************************

Namones = Array("", A, B, C, d, E, F, G, H, i)

Namtens = Array("", K, N, O, P, Q, R, s, T, U)

Namhuns = Array("", V, W, C1, D1, E1, F1, G1, H1, I1)

'************************************************************************

deci1 = Right(cnumber, 1)

deci2 = Left(Right(cnumber, 2), 1)

point = Left(Right(cnumber, 3), 1)

ones = Left(Right(cnumber, 4), 1)

tens = Left(Right(cnumber, 5), 1)

huns = Left(Right(cnumber, 6), 1)

thou = Left(Right(cnumber, 7), 1)

tent = Left(Right(cnumber, 8), 1)

hunt = Left(Right(cnumber, 9), 1)

mlun = Left(Right(cnumber, 10), 1)

tenm = Left(Right(cnumber, 11), 1)

hunm = Left(Right(cnumber, 12), 1)

'************************************ Þíã ÇÓãÇÁ ÇáÎÇäÇÊ **********************

onesplace = Namones(ones) '** Defulte ones *****1

tensplace = Namtens(tens) '** Defulte tens *****2

hunsplace = Namhuns(huns) '** Defulte huns *****3

'*****************************************************

If thou = 0 Then

thouplace = ""

Else

thouplace = Namones(thou) '** Defulte thou *****4

End If

'*****************************************************

If tent = 0 Then

tentplace = ""

Else

tentplace = Namtens(tent) '** Defulte tent *****5

End If

'*****************************************************

If hunt = 0 Then

huntplace = ""

Else

huntplace = Namhuns(hunt) '** Defulte hunt *****6

End If

'*****************************************************

If mlun = 0 Then

mlunplace = ""

Else

mlunplace = Namones(mlun) '*** Defulte mlun *****7

End If

'*****************************************************

If tenm = 0 Then

tenmplace = ""

Else

tenmplace = Namtens(tenm) '*** Defulte tenm *****8

End If

'*****************************************************

If hunm = 0 Then

hunmplace = ""

Else

hunmplace = Namhuns(hunm) '*** Defulte hunm *****9

End If

'*****************************************************

If deci1 = 0 Then

deci1place = ""

Else

'deci1place = Namones(deci1) '** Defulte deci1 *****10

deci1place = Str(deci1) '****************** íÒÇá åÐÇ ÇáÓØÑ Ýí ÍÇá ÇÓÊÚãÇá ÇáÊÝÞíØ áÛíÑ ÇáåááÇÊ ********

End If

'*****************************************************

If deci2 = 0 Then

deci2place = ""

Else

'deci2place = Namtens(deci2) '** Defulte deci2 *****11

deci2place = Str(deci2) '****************** íÒÇá åÐÇ ÇáÓØÑ Ýí ÍÇá ÇÓÊÚãÇá ÇáÊÝÞíØ áÛíÑ ÇáåááÇÊ ********

End If

'***************************************************************

'*****************************************************************'''*

If deci1 = 0 And deci2 > 0 Then '***** íÓÊÚãá åÐÇ ÇáÊÚÈíÑ Ýí ÍÇá ÑÞã ÂÍÇÏ ãä ÚÔÑå ''*

deci1place = Str(0) '****************** íÒÇá åÐÇ ÇáÓØÑ Ýí ÍÇá ÇÓÊÚãÇá ÇáÊÝÞíØ áÛíÑ ÇáåááÇÊ ********

'deci2place = Namones(deci2) ' '*

End If '*

'*****************************************************************'''*

'******************************************* ÇáÇáÞÇÈ **************************

'***************************** For ÃáÝ æ ÂáÇÝ **********************

If thou > 2 And tent = 0 And hunt = 0 Then

Add1 = " " + Y

ElseIf thou = 0 And tent = 0 And hunt = 0 Then

Add1 = ""

Else

Add1 = " " + X

End If

'***************************** For ãáíæä ***********************

If mlun = 0 And tenm = 0 And hunm = 0 Then

Add2 = ""

Else

Add2 = " " + ZA

End If

'***************************** For ãä ÚÔÑå æãÇÆå ááß ************

'*** If deci1 = 0 And deci2 > 0 Then

'*** Add3 = J :ZD = " ãä "

'*** ElseIf deci1 > 0 Then

'*** Add3 = V:ZD = " ãä "

'*** End If

'If deci1 = 0 And deci2 = 0 Then

'Add3 = "" :ZD = ""

'End If

'*****************************************************

'*************************************************************************

'**************************** For ÃáÝ æ ÃáÝÇä ÝÞØ *******************

If thou = 1 And tent = 0 And hunt = 0 Then

thouplace = X: Add1 = ""

ElseIf thou = 2 And tent = 0 And hunt = 0 Then

thouplace = Z: Add1 = ""

End If

'*************************** For ãáíæä æ ãáíæäÇä ÝÞØ *****************

If mlun = 1 And tenm = 0 And hunm = 0 Then

mlunplace = ZA: Add2 = ""

ElseIf mlun = 2 And tenm = 0 And hunm = 0 Then

mlunplace = ZB: Add2 = ""

ElseIf ones = 9 And tenm = 0 And hunm = 0 Then

onesplace = AA: Add2 = ""

ElseIf ones = 3 And tenm = 0 And hunm = 0 Then

onesplace = W3: Add2 = ""

ElseIf ones = 5 And tenm = 0 And hunm = 0 Then

onesplace = W5: Add2 = ""

End If

'****************************** For 10 , 11 , 12 *************************

'************************10,11,12 ááßÓæÑ

'If deci2 = 1 And deci1 = 0 Then '****************** íÒÇá åÐÇ ÇáÓØÑ Ýí ÍÇá ÇÓÊÚãÇá ÇáÊÝÞíØ áÛíÑ ÇáåááÇÊ ********

'deci2place = J

'End If

'If deci2 = 1 And deci1 = 1 Then

'deci1place = ""

'deci2place = L

'End If

'If deci2 = 1 And deci1 = 2 Then

'deci1place = ""

'deci2place = M

'End If *******************************************************************

'************************10,11,12

If tens = 1 And ones = 0 Then

tensplace = J

End If

If tens = 1 And ones = 1 Then

onesplace = ""

tensplace = L

End If

If tens = 1 And ones = 2 Then

onesplace = ""

tensplace = M

End If

'************************10,11,12 ÇáÝ

If tent = 1 And thou = 0 Then

tentplace = J + " " + Y

Add1 = ""

End If

If tent = 1 And thou = 1 Then

thouplace = ""

tentplace = L

End If

If tent = 1 And thou = 2 Then

thouplace = ""

tentplace = M

End If

'************************10,11,12, ãáíæä

If tenm = 1 And mlun = 0 Then

tenmplace = J + " " + ZA

Add2 = ""

End If

If tenm = 1 And mlun = 1 Then

mlunplace = ""

tenmplace = L

End If

If tenm = 1 And mlun = 2 Then

mlunplace = ""

tenmplace = M

End If

'******************************* End Section For 10 , 11 , 12 *********************

'************************************* Position For "æ" ************************

AN1 = ZC: AN2 = ZC: AN3 = ZC: AN4 = ZC: AN5 = ZC: AN6 = ZC: AN7 = ZC: AN8 = ZC: AN9 = ZC: AN10 = ZC

'***********************************

If mlun > 0 And tenm > 0 And hunm = 0 Then

AN7 = ZC: AN8 = ""

End If

If mlun > 0 And tenm = 0 And hunm > 0 Then

AN7 = "": AN8 = ZC

End If

If mlun = 0 And tenm > 0 And hunm > 0 Then

AN7 = "": AN8 = ZC

End If

If mlun > 0 And tenm = 1 And hunm > 0 Then

AN7 = "": AN8 = ZC

End If

If mlun = 0 And tenm = 0 And hunm = 0 Then

AN7 = "": AN8 = "": AN6 = ""

End If

If mlun > 0 And tenm = 0 And hunm = 0 Then

AN7 = "": AN8 = ""

End If

If mlun = 0 And tenm > 0 And hunm = 0 Then

AN7 = "": AN8 = ""

End If

If mlun > 0 And tenm = 1 And hunm = 0 Then

AN7 = "": AN8 = ""

End If

If mlun = 0 And tenm = 0 And hunm > 0 Then

AN7 = "": AN8 = ""

End If

'***********************************

If thou > 0 And tent > 0 And hunt = 0 Then

AN4 = ZC: AN5 = ""

End If

If thou > 0 And tent = 0 And hunt > 0 Then

AN4 = "": AN5 = ZC

End If

If thou = 0 And tent > 0 And hunt > 0 Then

AN4 = "": AN5 = ZC

End If

If thou > 0 And tent = 1 And hunt > 0 Then

AN4 = "": AN5 = ZC

End If

If thou = 0 And tent = 0 And hunt = 0 Then

AN4 = "": AN5 = "": AN3 = ""

End If

If thou > 0 And tent = 0 And hunt = 0 Then

AN4 = "": AN5 = ""

End If

If thou = 0 And tent > 0 And hunt = 0 Then

AN4 = "": AN5 = ""

End If

If thou > 0 And tent = 1 And hunt = 0 Then

AN4 = "": AN5 = ""

End If

If thou = 0 And tent = 0 And hunt > 0 Then

AN4 = "": AN5 = ""

End If

'***********************************

If ones > 0 And tens > 0 And huns = 0 Then

AN2 = "": AN1 = ZC

End If

If ones > 0 And tens = 0 And huns > 0 Then

AN1 = "": AN2 = ZC

End If

If ones = 0 And tens > 0 And huns > 0 Then

AN1 = "": AN2 = ZC

End If

If ones > 0 And tens = 1 And huns > 0 Then

AN1 = "": AN2 = ZC

End If

If ones = 0 And tens = 0 And huns = 0 Then

AN1 = "": AN2 = ""

End If

If ones > 0 And tens = 0 And huns = 0 Then

AN1 = "": AN2 = ""

End If

If ones = 0 And tens > 0 And huns = 0 Then

AN1 = "": AN2 = ""

End If

If ones > 0 And tens = 1 And huns = 0 Then

AN1 = "": AN2 = ""

End If

If ones = 0 And tens = 0 And huns > 0 Then

AN1 = "": AN2 = ""

End If

'*********************************

If (ones Or tens Or huns) = 0 And (thou Or tent Or hunt) > 0 And (mlun Or tenm Or hunm) = 0 Then

AN3 = "": AN6 = ""

ElseIf (ones Or tens Or huns) = 0 And (thou Or tent Or hunt) > 0 And (mlun Or tenm Or hunm) > 0 Then

AN3 = "": AN6 = ZC

ElseIf (ones Or tens Or huns) = 0 And (thou Or tent Or hunt) = 0 And (mlun Or tenm Or hunm) > 0 Then

AN3 = "": AN6 = ""

ElseIf (ones Or tens Or huns) = 0 And (thou Or tent Or hunt) = 0 And (mlun Or tenm Or hunm) = 0 Then

AN9 = ""

End If

'*********************************

If deci1 = 0 And deci2 = 0 Then

AN9 = "": AN10 = "": ZD = ""

ElseIf deci1 = 0 And deci2 > 0 Then

AN10 = ""

ElseIf deci1 > 0 And deci2 = 0 Then

AN10 = ""

ElseIf deci1 > 0 And deci2 = 1 Then

AN10 = ""

End If

AN10 = "" '****************** íÒÇá åÐÇ ÇáÓØÑ Ýí ÍÇá ÇÓÊÚãÇá ÇáÊÝÞíØ áÛíÑ ÇáåááÇÊ ********

'***************************************** End Position For æ *****************

'****************************** ÑíÇá æåááå **********************************

Type1 = ZE: Type2 = ZG

If ones = 0 And tens = 0 And huns = 0 And thou = 0 And tent = 0 And hunt = 0 And mlun = 0 And tenm = 0 And hunm = 0 Then

Type1 = ""

ElseIf ones = 1 And tens = 0 And huns = 0 And thou = 0 And tent = 0 And hunt = 0 And mlun = 0 And tenm = 0 And hunm = 0 Then

onesplace = ""

ElseIf ones = 2 And tens = 0 And huns = 0 And thou = 0 And tent = 0 And hunt = 0 And mlun = 0 And tenm = 0 And hunm = 0 Then

Type1 = ZF: onesplace = ""

End If

If deci1 = 0 And deci2 = 0 Then

Type2 = ""

ElseIf deci1 = 1 And deci2 = 0 Then

Type2 = ZG: deci1place = ""

ElseIf deci1 = 2 And deci2 = 0 Then

Type2 = ZH: deci1place = ""

ElseIf deci1 = 0 And deci2 = 1 Then

Type2 = ZI

ElseIf deci1 > 2 And deci2 = 0 Then

Type2 = ZI

End If

If ones = 0 And tens = 0 And huns = 0 And thou = 0 And tent = 0 And hunt = 0 And mlun = 0 And tenm = 0 And hunm = 0 And deci1 = 0 And deci2 = 0 Then

Type1 = "": Type2 = "": ZZ = ""

End If

'*************************************************************************

If ones = 3 And tens = 0 And huns = 0 And thou = 0 And tent = 0 And hunt = 0 And mlun = 0 And tenm = 0 And hunm = 0 Then

ZE = "ÑíÇáÇÊ"

End If

'****************************************** Output Field *********************

Word3 = hunmplace + AN8 + mlunplace + AN7 + tenmplace + Add2 + AN6 + huntplace + AN5 + thouplace + AN4 + tentplace + Add1 + AN3 + hunsplace + AN2 + onesplace + AN1 + tensplace + Type1 + AN9 + deci1place + AN10 + deci2place + ZD + Add3 + Type2 + ZZ

'******************************************End Output Field *******************

My_Exit:

Exit Function

My_Err:

Resume My_Exit

End Function

#4

اخوي جرب هذا المثال

ان شاء الله مضبوط مئه بالمئه

100%

وردلي خبر

Number.rar

من قال فيني عيب والله ظلمني ×× فيني ثمان عيوب والتاسع الطيب

العاشر ليا من رفـيقي زهمني ×× اسوق له عمري واسوق المواجيب

#5

شكراً للجميع

صراحة كل الامثلة كانت ممتازة ولكن مثال الاخ Salem هيا كانت مطلوبة.

شكراً جميعً........................

مواضيع مشابهة