目前分類:程式設計 (25)

瀏覽方式: 標題列表 簡短摘要

這是前幾天在PTT Visual_Basic版看到的網友發問,

他的作業是想要寫一個矩陣計算程式,支援各階矩陣,

所以程式本身必須先能依使用者輸入的階乘數 N ,自動展開 N×N 個格子供使用者輸入每個矩陣元。

 

本來我的想法是:「咦!我好像還沒看過哪本書上有寫到,什麼程式碼可以產生一個物件(如 Textbox)的喔?」

Google 找一找,還真的找不到 -_-,當然,也有可能是關鍵字太難設了,怎麼找都找到一堆不相關的東西,

後來我乾脆放棄這個簡單的想法,想用 DataGrid 或 MSFlexGrid 來完成這個任務,

DataGrid 支援隨時輸入資料到方格里,而且理論上 DataGrid、MSFlexGrid 都支援以程式碼控制其行數與列數的,

(雖然他們本來都只是拿來放資料庫的資料而已 -_-)

不過測試之下,DataGrid 好像不能控制其行、列數,

MSFlexGrid 可以,但卻不能像 DataGrid 一樣任意輸入文字,純粹只能 Show 程式碼裡寫好的東西,

上 Google 找了一下,發現大家都有這個問題,然後大陸網站提供的程式碼...打不開!有的打開了,裡面卻寫一堆似是而非的東西 -_-

最後,我決定在 MSFlexGrid 的 Click 事件設定成跳出 InputBox,並將由 InputBox 獲得的資料,指定給自定義的二維陣列(以座標為index),

要做矩陣計算時,再拿陣列的元素,依矩陣計算方法來做計算的話,應該是再簡單不過了,

哇哈,這樣還真的就成了,

關鍵的 MSFlexGrid Click 事件中,測出 MSFlexGrid 支援提供每個格子的座標,所以就可以依座標、指定每一陣列元素,代表每一格的值了。

genlee 發表在 痞客邦 留言(0) 人氣()

找了許久,終於找到 Borland C++ Builder 5 的 ADOExpress 更新檔了,

目前的工作,從上禮拜開始,卡著一個 bug 到現在,

曾經看到不少篇文章提到,這個錯誤訊息是 BCB 在 ADO 上很久以來的 bug,

連我剛剛忍不住打去問外包的廖先生,他也是知道這個問題,只會用繞道的方式繞過這個 bug:

我也是用繞的方式去解決啊-_-,但是有時候仍然失效給我看 -_-

不過,剛剛居然被我找到還活著的下載點了!!

安裝之後,同樣的問題仍然存在。

 

「!?」

 

對,仍然存在,見鬼了~~

 

不過亂試了幾下,發現問題被解決了,

在砍掉之前繞掉 bug 的程式碼之間,我突然想到一個有可能造成問題的錯誤:「在某些條件下,資料表會被清空兩次!」

沒想到,砍掉之後,所有的問題都解決了

genlee 發表在 痞客邦 留言(2) 人氣()

  • 這是一篇加密文章,請輸入密碼
  • 密碼提示:
  • 請輸入密碼:
  • 這是一篇加密文章,請輸入密碼
  • 密碼提示:
  • 請輸入密碼:
(From http://www.w3schools.com/PHP/func_mail_mail.asp )

mail(to,subject,message,headers,parameters)

Parameter Description
to Required. Specifies the receiver / receivers of the email
subject Required. Specifies the subject of the email. Note: This parameter cannot contain any newline characters
message Required. Defines the message to be sent. Each line should be separated with a LF (\n). Lines should not exceed 70 characters.

Windows note: If a full stop is found on the beginning of a line in the message, it might be removed. To solve this problem, replace the full stop with a double dot:
<?php
$txt = str_replace("\n.", "\n..", $txt);
?>

headers Optional. Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF (\r\n).

Note: When sending an email, it must contain a From header. This can be set with this parameter or in the php.ini file.

parameters Optional. Specifies an additional parameter to the sendmail program (the one defined in the sendmail_path configuration setting). (i.e. this can be used to set the envelope sender address when using sendmail with the -f sendmail option)

genlee 發表在 痞客邦 留言(0) 人氣()

«12