TL : 4 자리 숫자를 더하고 16 진수 값을 나타내는 문자열 (예 : 10 + 5를 "F"로 저장하거나 2 + 1을 " 3 ")작은 이야기 : int를 16 진수 문자열로 변환하는 방법은 무엇입니까? (비주얼 작품)
.
여기 한 번 전에 물어 본 적이 있지만 답변이 부족하여 신청할 수 없습니다. 나는 아래 운영하고 있는데 제가 의견 좀하고 싶습니다 방법을 보여줍니다 : 여기
| response bit1 bit2 bit3 bit4 addedBits objStatus|
"are objects on station1?"
(self robot hasWaferAt: 1)
ifTrue:[bit1:=2r1000.bit3:=2r10.]
ifFalse:[bit1:=2r0000.bit3:=2r00.].
"are objects on station2?"
(self robot hasWaferAt: 2)
ifTrue:[bit2:=2r100.bit4:=2r1.]
ifFalse:[bit2:=2r000.bit4:=2r0.].
addedBits := (((bit1 bitOr: bit2)bitOr: bit3)bitOr: bit4).
내가 문자열로 addedBits를 개최 objStatus 필요해 (addedBits 13 waferStatus은 "D"를 개최 할 필요가있다 즉 경우 또는 'D') 그때 TCPIP를 통해이 문자열을 전송하기 때문에 :
response := (myCommand getUnitNumberFromResponse: aCommandString),
(myCommand getSequenceNumberFromResponse: aCommandString),
'0000', "Ack code"
'0000', "error code: 0000 is success."
waferStatus, "which stations have objects"
'FFF'. "no objects present = FFFF"
response := (myCommand commandResponsePrefix),
response,
(myCommand computeChecksum: response).
self sendMessage: response.
감사합니다! 내 작품 '프랑켄슈타인'을 잘 해결해. 4 가지 가능한 결과를 확인하기 위해 일련의 네 가지 중첩 if 문을 수행했습니다. 이것은 분명히 개선이다. – DarthSheldon