If ¹Bºâ¦¡¤]¬O ¤@Ó¹Bºâ¦¡¡A¤]´N¬O»¡¡A¥¦·|Åçºâ«ü©w«¬§OÈ¡C°²¦p¨S¦³ Else ¤l¥y¡A¦Ó¥B±ø¥ó¬° False ®É¡A«h¹Bºâ¦¡ªºÈ´N¬O¸Ó«¬§Oªº¹w³]È¡C¨Ò¦p¡G
If Length ({û¤u.¦W¦r}) < 5 Then
"²µu"
¥H¤Wªº If ¹Bºâ¦¡·|¶Ç¦^¦r¦êÈ¡C¦pªGû¤uªº¦W¦r¤Ö©ó¤Ó^¤å¦r¥À¡A¶Ç¦^ªº¦r¦êȬ° "²µu"¡F¦pªGû¤uªº¦W¦r¶W¹L¤Ó^¤å¦r¥À¡A«h¶Ç¦^ªÅ¥Õ¦r¦ê ""¡C
½Ð·Q¤@·Q¤U±³oÓ¤½¦¡¡G
If Year({q³f¥DÀÉ.q³f¤é´Á}) >= 1995 Then
{q³f¥DÀÉ.q³f¤é´Á}
¦pªGq³f¤é´Á¦©ó 1995 ¦~¡A¥H¤Wªº If ¹Bºâ¦¡·|¶Ç¦^ Null ¤é´Á®É¶¡È¡C¥Ñ©ó {Orders.Order Date} ¬O¤é´Á®É¶¡¸ê®Æ®wÄæ¦ì¡A¦]¦¹¨äȬO¤é´Á®É¶¡È¡A¦Ó¤£¬O¤é´ÁÈ¡CCrystal Reports ¤£·|¦C¦L Null ¤é´Á®É¶¡È¡A¦]¦¹¡A¦pªG±N¥H¤W¤½¦¡©ñ¦b³øªí¤¤¡A1995 ¦~¤§«eq³f¤é´Áªº¤½¦¡Äæ¦ì´N·|¬OªÅ¥Õªº¡CNull ®É¶¡È©M Null ¤é´ÁȪº³B²z¤è¦¡Ãþ¦ü¡C
¤U±³oÓ½d¨Ò±N»¡©ú¦p¦ó¨Ï¥Î¬A¸¹¡A°õ¦æ¤@Ó¥H¤Wªº¹Bºâ¦¡¡A·í°µ If ±ø¥óªºµ²ªG¡C¬Y¤½¥q¹ï¤T¤Ñ¤§¤º°e¨ìªºq³æ¦¬¨ú 5% ªº¶O¥Î¡A¨ä¥Lªº«h¦¬¨ú 2%¡C¸Ó¤½¥q§Æ±æ¨Ì·Ó±¡ªp¦C¦L¥X¡u«æ¥ó¥X³f $100.00¡v©Î¡u¤@¯ë¥X³f $20.00¡vµ¥¾A·í°T®§¡C
Local StringVar message;
Local CurrencyVar ship;
If {q³f¥DÀÉ.°e³f¤é´Á} - {q³f¥DÀÉ.q³f¤é´Á} <= 3 Then
(
message := "«æ¥ó";
//A semicolon at the end of the next line
//is optional
ship := {q³f¥DÀÉ.q³fª÷ÃB} * 0.05
} //A semicolon cannot be placed here
Else
(
message := "´¶³q";
ship := {q³f¥DÀÉ.q³fª÷ÃB} * 0.02;
);
//The preceding semicolon is required to seperate the
//If expression from the final expression below
message & "¥X³f" & CStr (ship)
·í±z¥Î¬A¸¹±N¹Bºâ¦¡²Õ¦¨¸s²Õ®É¡A·|±N¾ãÓ¸s²Õµø¬°³æ¤@¹Bºâ¦¡¡A¦Ó¥¦ªºÈ¤Î«¬§O«K¬O¬A¸¹¤¤³Ì«á¤@Ó¹Bºâ¦¡ªºÈ¤Î«¬§O¡C
//The parentheses group expression as a whole has
//Currency type
(
//The first expression in the parentheses has
//String type
message := "«æ¥ó";
//The second and final expression in parentheses
//has Currency type
ship := {Orders.Order Amount} * 0.05;
)
¨Ò¦p¡A¤U¦C¤½¦¡·|²£¥Í¿ù»~¡Aì¦]¬O If ¹Bºâ¦¡¤¤ªº Then ³¡¤À·|¶Ç¦^³f¹ôÈ¡A¦Ó Else ³¡¤À«h·|¶Ç¦^¦r¦êÈ¡C³o¬O¤£³Q¤¹³\ªº¡A¦]¬° If ¹Bºâ¦¡¥»¨¬O¤@Ó¹Bºâ¦¡¡A¦]¦¹¶Ç¦^ªºÈ¥²¶·¬O¦P¤@ºØ«¬§O¡C
//An erroneous formula
Local StringVar message;
Local CurrencyVar ship;
If {q³f¥DÀÉ.°e³f¤é´Á} - {q³f¥DÀÉ.q³f¤é´Á} <= 3 Then
(
message := "«æ¥ó";
ship := {q³f¥DÀÉ.q³fª÷ÃB} * 0.05
)
Else
(
//The following 2 lines were interchanged
ship := {q³f¥DÀÉ.q³fª÷ÃB} * 0.02;
message := "´¶³q";
);
message & "¥X³f" & CStr (ship)
¦³¤@Ó¤èªk¤£¥Î²z·|¹Bºâ¦¡ªº¶¶§Ç´N¥i¥H×¥¿³oÓ¿ù»~ªº¤½¦¡¡A´N¬OÅý If ¹Bºâ¦¡ªº¨C¤@Ó¤À¤ä³£¶Ç¦^¬Û¦P«¬§Oªº±`¼ÆÈ¡C¨Ò¦p¡AIf ¹Bºâ¦¡²{¦b·|¶Ç¦^¼ÆÈ 0¡G
//Repaired the erroneous formula
Local StringVar message;
Local CurrencyVar ship;
If {q³f¥DÀÉ.°e³f¤é´Á} - {q³f¥DÀÉ.q³f¤é´Á} <= 3 Then
(
message := "«æ¥ó";
ship := {Orders.Order Amount} * 0.05;
0
)
Else
(
ship := {q³f¥DÀÉ.q³fª÷ÃB} * 0.02;
message := "´¶³q";
0
);
message & "¥X³f" & CStr (ship)